Skip to content

Commit

Permalink
Allow precommand hook to export env vars in same shell (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
shYkiSto authored Sep 26, 2024
1 parent eb6d339 commit 22b1244
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ else
# precommand hook
NOW=$(bash -p "$GLOBAL_BIN/now")
DURATION=$((NOW - START + BOOTSTRAP_TIME))
(cd "$ROOT" && VERSION="$VERSION" DURATION="$DURATION" COMMAND="$1" COMMAND_ARGS="${@:2}" EXIT_CODE=$EXIT_CODE eval "$PRECOMMAND")
COMMAND_CWD=$(pwd)
cd $ROOT
VERSION="$VERSION" DURATION="$DURATION" COMMAND="$1" COMMAND_ARGS="${@:2}" EXIT_CODE=$EXIT_CODE eval "$PRECOMMAND"
cd $COMMAND_CWD

# payload
export NODE_NO_WARNINGS=1 # hide [MODULE_NOT_FOUND] errors
Expand Down

0 comments on commit 22b1244

Please sign in to comment.