Skip to content

Commit

Permalink
Restored behaviour or switching checkout path via ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
keithpitt committed Oct 15, 2015
1 parent 45d5e81 commit 86eb0c0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions templates/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,8 @@ buildkite-global-hook "post-checkout"
buildkite-local-hook "post-checkout"

# If the working directory has been changed by a hook, log and switch to it
if [[ "$BUILDKITE_BOOTSTRAP_WORKING_DIRECTORY" != "" ]] && [[ "$BUILDKITE_BUILD_CHECKOUT_PATH" != "$BUILDKITE_BOOTSTRAP_WORKING_DIRECTORY" ]]; then
echo "~~~ A post-checkout hook has changed the working directory to $BUILDKITE_BOOTSTRAP_WORKING_DIRECTORY"
BUILDKITE_BUILD_CHECKOUT_PATH=$BUILDKITE_BOOTSTRAP_WORKING_DIRECTORY
if [[ "$BUILDKITE_BUILD_CHECKOUT_PATH" != "$PREVIOUS_BUILDKITE_BUILD_CHECKOUT_PATH" ]]; then
echo "~~~ A post-checkout hook has changed the working directory to $PREVIOUS_BUILDKITE_BUILD_CHECKOUT_PATH"

if [ -d "$BUILDKITE_BUILD_CHECKOUT_PATH" ]; then
buildkite-run "cd $BUILDKITE_BUILD_CHECKOUT_PATH"
Expand Down

0 comments on commit 86eb0c0

Please sign in to comment.