Skip to content

Commit 02e832d

Browse files
authored
Fix unexpected subshell execution in bootstrap.sh (#678)
For `(list)` in bash, `list` is executed in a subshell environment. Variable assignments do not remain in effect after the command completes. Fix by using `{ list; }`, where `list` is executed in the current shell environment.
1 parent 9eda5e2 commit 02e832d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ if [ ! -z "${DESIRED_BOOST_DIR}" ]; then
108108
else
109109
# New way of installing boost:
110110
# Check whether we have the required boost packages installed
111-
(BOOST_VERSION=$(echo -e '#include <boost/version.hpp>\nBOOST_LIB_VERSION' | gcc -s -x c++ -E - 2>/dev/null| grep "^[^#;]" | tr -d '\"')) || true
111+
{ BOOST_VERSION=$(echo -e '#include <boost/version.hpp>\nBOOST_LIB_VERSION' | gcc -s -x c++ -E - 2>/dev/null| grep "^[^#;]" | tr -d '\"'); } || true
112112

113113
if [ -z "$BOOST_VERSION" ] ;then
114114
if [ -x "$(command -v pacman)" ]; then

0 commit comments

Comments
 (0)