Skip to content

Support bash versions prior to 4.2#577

Open
danielchasehooper wants to merge 1 commit intoEpicGamesExt:masterfrom
danielchasehooper:master
Open

Support bash versions prior to 4.2#577
danielchasehooper wants to merge 1 commit intoEpicGamesExt:masterfrom
danielchasehooper:master

Conversation

@danielchasehooper
Copy link

The if [ -v variable ] syntax was introduced in bash 4.2, so in order to support prior bash versions, I reverted to the if [ "$var" = "1" ] syntax.

To avoid unbound variable errors caused by set -u, I assign 0 to variables before doing argument parsing. There are pre-bash-4.2 ways to check if a variable is set without triggering the unbound variable warning (such as if [ "${clang+set}"] ) but that's pretty weird looking, so I thought it was simpler to just declare the variables ahead of time.

I realize that you removed that syntax, likely due to a combination of wanting the cleaner -v syntax, and needing to play nice with the set -u unbound variable check, but hopefully the incompatibility with bash <4.2 was an oversight and not a choice (I was just trying to build with bash 3.2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant