diff --git a/setup-update-tag.sh b/setup-update-tag.sh index fbb06e3..8571e3d 100755 --- a/setup-update-tag.sh +++ b/setup-update-tag.sh @@ -3,13 +3,6 @@ set -euo pipefail IFS=$'\n\t' -function finish { - if [ -e "$tmpfile" ]; then - rm "$tmpfile" - fi -} -trap finish EXIT - if ! command -v reg > /dev/null; then echo "Please install reg in order to run this script." exit 1 @@ -20,6 +13,13 @@ if [ ! -e ./.env ]; then exit 1 fi +function finish { + if [ -e "$tmpfile" ]; then + rm "$tmpfile" + fi +} +trap finish EXIT + # this is a kind of ugly hack to be able to source the env file # this is sadly needed since postfix in https://github.com/tomav/docker-mailserver/ cannot deal with quoted values tmpfile=$(mktemp /tmp/kopano-docker-env.XXXXXX)