root: fix setupHook to work with "set -u"

This commit is contained in:
Dmitry Kalinkin
2019-11-24 17:51:46 -05:00
parent 35d99698ae
commit bd0c4dd6ab

View File

@@ -1,9 +1,13 @@
thisroot () {
# Workaround thisroot.sh dependency on man
if [ -z "${MANPATH}" ]; then
if [ -z "${MANPATH-}" ]; then
MANPATH=:
fi
local oldOpts="-u"
shopt -qo nounset || oldOpts="+u"
set +u
source @out@/bin/thisroot.sh
set "$oldOpts"
}
postHooks+=(thisroot)