#!/usr/bin/env bash

if [[ -z ${NCS_DISTRO} ]]; then
  echo "! Please provice NCS_DISTRO"
  exit 1
fi

 # Invalidate Distro
if [[ -f ${HOME}/.aws/credentials && -n ${NCS_DISTRO} && -z ${BUILD_NOINVALIDATE} ]]; then
   echo "- Invalidating ${NCS_DISTRO}"
   aws cloudfront create-invalidation --distribution-id "${NCS_DISTRO}" --paths "/*"
fi

