Detect unexported variables in fish correctly (#290)

Fixes #289
This commit is contained in:
Anshuman Medhi 2023-03-17 00:55:52 +08:00 committed by GitHub
parent 8012396587
commit 9bb53dc455
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,14 +7,14 @@ if [ ! -e "$FORGIT" ]
end
function forgit::warn
printf "%b[Warn]%b %s\n" '\e[0;33m' '\e[0m' "$argv" >&2;
printf "%b[Warn]%b %s\n" '\e[0;33m' '\e[0m' "$argv" >&2
end
# backwards compatibility:
# export all user-defined FORGIT variables to make them available in git-forgit
set unexported_vars 0
set | awk -F ' ' '{ print $1 }' | grep FORGIT_ | while read var
if ! set -x | grep -q "^$var "
if not set -x | grep -q "^$var\b"
if test $unexported_vars = 0
forgit::warn "Config options have to be exported in future versions of forgit."
forgit::warn "Please update your config accordingly:"