Fixes bug in bpkg-install global check

The bug occurred when a "global" section was present in a `packages.json` file but had a value other than "true".
Due to the logic of the check, such a package would then be marked for global install.
pull/102/head
Ben Peachey 6 years ago committed by Joseph Werle
parent b3e80ec22f
commit d843146bd0

@ -341,7 +341,7 @@ bpkg_install_from_remote () {
)"
## check if forced global
if [[ ! -z "$(echo -n "${json}" | bpkg-json -b | grep '\["global"\]' | awk '{ print $2 }' | tr -d '"')" ]]; then
if [[ "$(echo -n "${json}" | bpkg-json -b | grep '\["global"\]' | awk '{ print $2 }' | tr -d '"')" == 'true' ]]; then
needs_global=1
fi

Loading…
Cancel
Save