support local scripts & env in run script
This commit is contained in:
parent
792806f304
commit
b8fab34418
1 changed files with 11 additions and 6 deletions
17
run
17
run
|
|
@ -3,13 +3,18 @@
|
||||||
RUN_BIN=$(realpath "$0")
|
RUN_BIN=$(realpath "$0")
|
||||||
RUN_DIR=$(dirname "$RUN_BIN")
|
RUN_DIR=$(dirname "$RUN_BIN")
|
||||||
|
|
||||||
export RUN_BIN
|
|
||||||
export RUN_DIR
|
|
||||||
|
|
||||||
task="$1"
|
task="$1"
|
||||||
shift
|
shift
|
||||||
|
|
||||||
# export DEBUG=1
|
: "${RUN_TASK:=$task}"
|
||||||
# export UNWIND_LOGLEVEL=DEBUG
|
|
||||||
|
|
||||||
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" "$@"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue