packer: update call to main

This commit is contained in:
Kyle Isom 2023-04-12 20:18:09 -07:00
parent 906d1ae5ac
commit 41d955b195
1 changed files with 9 additions and 1 deletions

View File

@ -2,6 +2,14 @@
set -euxo pipefail set -euxo pipefail
if [[ "${BASH_SOURCE[0]}" = "${0}" ]]
then
set -euxo pipefail
RUN_MAIN=yes
else
RUN_MAIN=no
fi
IMAGE_TYPE="${1:-ubuntu}" IMAGE_TYPE="${1:-ubuntu}"
PACKER_BUILD_FILE="${2:-}" PACKER_BUILD_FILE="${2:-}"
SKIP_LOCAL_CACHE="${SKIP_LOCAL_CACHE:-no}" SKIP_LOCAL_CACHE="${SKIP_LOCAL_CACHE:-no}"
@ -86,7 +94,7 @@ main () {
build_image build_image
} }
if [ "$0" = "-bash" ] if [[ "${RUN_MAIN}" = "yes" ]]
then then
main main
fi fi