Skip to content

Commit

Permalink
Use empty CDPATH with cd in abs_dirname/expand_path
Browse files Browse the repository at this point in the history
While not recommended [1] `CDPATH` might be exported and would be used
for e.g. `cd test` instead of using `./test`.
E.g. Vim will make use of it (and therefore it needs to be exported, if
you do not want to configure it twice).

Fixes sstephenson#104.

This supersedes sstephenson#119: there is
no need to unset/change CDPATH globally.

1: https://bosker.wordpress.com/2012/02/12/bash-scripters-beware-of-the-cdpath/
  • Loading branch information
blueyed committed Nov 22, 2016
1 parent 0360811 commit 5ff9e72
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libexec/bats
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash
set -e
# Set priviledged mode, which also discards CDPATH.
set -p

version() {
echo "Bats 0.4.0"
Expand Down

0 comments on commit 5ff9e72

Please sign in to comment.