Skip to content

Commit

Permalink
Unset CDPATH to prevent weird problems
Browse files Browse the repository at this point in the history
but allow suppressing this behavior in case someone is testing something
that relies on CDPATH.

Fixes: sstephenson#104
  • Loading branch information
msabramo committed Sep 8, 2015
1 parent 955309a commit 7173466
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libexec/bats
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash
set -e
if [ ! -z "$CDPATH" -a -z "$BATS_KEEP_CDPATH" ]; then
echo "Unsetting CDPATH to prevent problems like https://github.com/sstephenson/bats/issues/104 ..."
echo "To suppress this behavior, set BATS_KEEP_CDPATH"
echo "You may want to consider not exporting CDPATH"
unset CDPATH
fi

version() {
echo "Bats 0.4.0"
Expand Down

0 comments on commit 7173466

Please sign in to comment.