From 9f1a91eedcb4d0695fc34f7c8f4f53d13e6d3a44 Mon Sep 17 00:00:00 2001 From: Jan Orel Date: Mon, 16 Oct 2023 18:10:16 +0200 Subject: [PATCH] shellcheck, syntax for alpine packer run.sh --- packer/alpine316/{alpine.json => alpine316.json} | 0 packer/alpine316/run.sh | 11 +++++------ 2 files changed, 5 insertions(+), 6 deletions(-) rename packer/alpine316/{alpine.json => alpine316.json} (100%) diff --git a/packer/alpine316/alpine.json b/packer/alpine316/alpine316.json similarity index 100% rename from packer/alpine316/alpine.json rename to packer/alpine316/alpine316.json diff --git a/packer/alpine316/run.sh b/packer/alpine316/run.sh index 13187a84..1345c77f 100755 --- a/packer/alpine316/run.sh +++ b/packer/alpine316/run.sh @@ -4,19 +4,18 @@ DISTRO=$1 DST=$2 -DIR_CURR=$(dirname $0) +DIR_CURR=$(dirname "$0") BASE_IMAGE=$DIR_BASE/$DISTRO.img PACKER_WORKING_DIR=$DIR_BUILD/_packer/$DISTRO -mkdir -p $PACKER_WORKING_DIR +mkdir -p "$PACKER_WORKING_DIR" packer build -force \ -var "base_image=${BASE_IMAGE}" \ -var "qemu_binary=${QEMU_BINARY}" \ -var "appliance_name=${DISTRO}" \ - -var "distro=${DISTRO}" \ -var "http_dir=${DIR_CURR}" \ -var "output_dir=${PACKER_WORKING_DIR}" \ - $DIR_CURR/alpine.json + "$DIR_CURR/$DISTRO.json" -mv $PACKER_WORKING_DIR/$DISTRO $DST -rmdir $DIR_BUILD/_packer/$DISTRO ||: +mv "$PACKER_WORKING_DIR/$DISTRO" "$DST" +rmdir "$DIR_BUILD/_packer/$DISTRO" ||: