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

fix /bin/sh if incompat #57

Merged
merged 1 commit into from
Mar 7, 2019
Merged

fix /bin/sh if incompat #57

merged 1 commit into from
Mar 7, 2019

Conversation

dzuelke
Copy link
Contributor

@dzuelke dzuelke commented Mar 7, 2019

'git config --get user.name' returns 'Travis CI', which because unquoted gets interpreted as two operators by if, and breaks:

$ bundle exec hatchet ci:setup
sh: 1: [: Travis: unexpected operator
sh-3.2$ if [ `git config --get user.name` ]; then echo 'already set'; else echo 'not set'; fi
sh: [: David: unary operator expected

much easier is to just use the exit status of --get instead

'git config --get user.name' returns 'Travis CI', which because unquoted gets interpreted as two operators by if, and breaks

much easier is to just use the exit status of --get instead
@schneems
Copy link
Contributor

schneems commented Mar 7, 2019

Thanks!

@schneems schneems merged commit a89fbfa into master Mar 7, 2019
@edmorley edmorley deleted the sh-if-fix branch August 27, 2020 08:43
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.

2 participants