Skip to content

Commit

Permalink
Add FLY_PROJECT_PATH env var for working in subdirectories
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkurt committed Jan 14, 2020
1 parent 85b09b3 commit 466ac9e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
#!/bin/sh -l

sh -c "flyctl $*"
if [ -n "$FLY_PROJECT_PATH" ]; then
PREV_PATH=$(pwd)
# Allow user to change directories in which to run Fly commands
cd "$FLY_PROJECT_PATH" || exit
fi
sh -c "flyctl $*"

ACTUAL_EXIT="$?"

if [ -n "$PREV_PATH" ]; then
# If we changed directories before, we should go back to where we were.
cd "$PREV_PATH" || exit
fi

exit $ACTUAL_EXIT

0 comments on commit 466ac9e

Please sign in to comment.