diff --git a/forgit.plugin.zsh b/forgit.plugin.zsh index 21bf56c..84696ee 100755 --- a/forgit.plugin.zsh +++ b/forgit.plugin.zsh @@ -21,8 +21,10 @@ FORGIT="$INSTALL_DIR/bin/git-forgit" # backwards compatibility: # export all user-defined FORGIT variables to make them available in git-forgit unexported_vars=0 +# Set posix mode in bash to only get variables, see #256. +[[ -n "$BASH_VERSION" ]] && set -o posix set | awk -F '=' '{ print $1 }' | grep FORGIT_ | while read -r var; do - if ! export | grep -q "^$var="; then + if ! export | grep -q "\(^$var=\|^export $var=\)"; then if [[ $unexported_vars == 0 ]]; then forgit::warn "Config options have to be exported in future versions of forgit." forgit::warn "Please update your config accordingly:" @@ -33,6 +35,7 @@ set | awk -F '=' '{ print $1 }' | grep FORGIT_ | while read -r var; do export "$var" fi done +[[ -n "$BASH_VERSION" ]] && set +o posix # register shell functions forgit::log() {