Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove set -u on yarn_install.sh to allow it to run on macos default bash #1930

Merged
merged 1 commit into from
May 31, 2022

Conversation

spikecurtis
Copy link
Contributor

On zsh (default on macos) yarn_install.sh fails like:

./scripts/yarn_install.sh: line 41: yarn_flags[*]: unbound variable

It seems that zsh is refusing to expand an empty array with set -u enabled, while bash happily does so. We could add an explicit if test, but that seems complex for such a short script.

Signed-off-by: Spike Curtis <spike@coder.com>
@spikecurtis spikecurtis requested a review from a team May 31, 2022 20:39
@deansheather
Copy link
Member

The script is using bash as it has the bang at the top. Interesting that there's differences between the two OS's bash installs

@dwahler
Copy link
Contributor

dwahler commented May 31, 2022

Looks like this is caused by an old bash version. The behavior changed in bash-4.4, but my Mac is still on version 3.2.57.

@spikecurtis spikecurtis merged commit 4b0ed06 into main May 31, 2022
@spikecurtis spikecurtis deleted the spike/yarn_install_setu branch May 31, 2022 20:50
@spikecurtis spikecurtis changed the title Remove set -u on yarn_install.sh to allow it to run on zsh Remove set -u on yarn_install.sh to allow it to run on macos default bash May 31, 2022
kylecarbs pushed a commit that referenced this pull request Jun 10, 2022
Signed-off-by: Spike Curtis <spike@coder.com>
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.

None yet

3 participants