From de94dc1911b6212123e6e64455c62651e98afd37 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Fri, 28 Oct 2022 16:18:25 -0500 Subject: [PATCH] Fix migrations --- root/etc/s6-overlay/s6-rc.d/init-migrations/run | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-migrations/run b/root/etc/s6-overlay/s6-rc.d/init-migrations/run index ff0874b..37f5b78 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-migrations/run +++ b/root/etc/s6-overlay/s6-rc.d/init-migrations/run @@ -19,10 +19,9 @@ for MIGRATION in $(find ${MIGRATIONS_DIR}/* | sort -n); do fi echo "[migrations] ${NAME}: executing..." chmod +x "${MIGRATION}" - EXIT_CODE=$( - /bin/bash "${MIGRATION}" - echo $? - ) + # Execute migration script in a subshell to prevent it from modifying the current environment + ("${MIGRATION}") + EXIT_CODE=$? if [[ ${EXIT_CODE} -ne 0 ]]; then echo "[migrations] ${NAME}: failed with exit code ${EXIT_CODE}, contact support" exit "${EXIT_CODE}"