From 9bb53dc455d09096cca066627adbf41eb7766f28 Mon Sep 17 00:00:00 2001 From: Anshuman Medhi Date: Fri, 17 Mar 2023 00:55:52 +0800 Subject: [PATCH] Detect unexported variables in fish correctly (#290) Fixes #289 --- conf.d/forgit.plugin.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf.d/forgit.plugin.fish b/conf.d/forgit.plugin.fish index fe97321..5e931a4 100644 --- a/conf.d/forgit.plugin.fish +++ b/conf.d/forgit.plugin.fish @@ -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:"