From 6559b1bae3ae4e852e68ea686b12a4bcb89ecc53 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 4 Apr 2016 15:57:17 +0200 Subject: [PATCH] Use privileged mode, which discards CDPATH 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 https://github.com/sstephenson/bats/issues/104. This supersedes https://github.com/sstephenson/bats/pull/119: there is no need to unset/change CDPATH globally. 1: https://bosker.wordpress.com/2012/02/12/bash-scripters-beware-of-the-cdpath/ --- libexec/bats | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libexec/bats b/libexec/bats index 71f392f7..ba3b90e5 100755 --- a/libexec/bats +++ b/libexec/bats @@ -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"