From b8fab34418593a2c532abf216a4c2e43de23e0d4 Mon Sep 17 00:00:00 2001 From: ducklet Date: Fri, 6 Aug 2021 12:18:21 +0200 Subject: [PATCH] support local scripts & env in run script --- run | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/run b/run index b163649..4b57027 100755 --- a/run +++ b/run @@ -3,13 +3,18 @@ RUN_BIN=$(realpath "$0") RUN_DIR=$(dirname "$RUN_BIN") -export RUN_BIN -export RUN_DIR - task="$1" shift -# export DEBUG=1 -# export UNWIND_LOGLEVEL=DEBUG +: "${RUN_TASK:=$task}" -exec "$RUN_DIR"/scripts/"$task" "$@" +export RUN_BIN +export RUN_DIR +export RUN_TASK + +script="$RUN_DIR"/scripts.local/"$task" +[ -f "$script" ] || script="$RUN_DIR"/scripts/"$task" + +[ -f "$RUN_DIR"/.env.local ] && . "$RUN_DIR"/.env.local + +exec "$script" "$@"