Various style fixes in mason.sh#489
Merged
springmeyer merged 5 commits intomapbox:masterfrom Feb 7, 2018
WesleyAC:shell-style
Merged
Various style fixes in mason.sh#489springmeyer merged 5 commits intomapbox:masterfrom WesleyAC:shell-style
springmeyer merged 5 commits intomapbox:masterfrom
WesleyAC:shell-style
Conversation
This replaces all instances of backtick substitution with $() substitution, since it has less surprises and undefined behaviour.
Using && for boolean and is preferred over -a for portable shell scripts because the -a syntax can be ambiguous, while the && syntax is not.
This is to prevent read from mangling backslashes
Contributor
|
Thank you for this PR @WesleyAC - looks great, and I'm grateful for the fixes. Just rebased and will merge once green. And yes, we should definitely run the code through something like https://www.shellcheck.net. I've ticketed that idea at #549 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed a few style sort of issues in
mason.sh, and fixed a few of them:$(...)-rflag toread-afor boolean and to&&, since it's easier to reason aboutIt might make sense to run some sort of linting tool as part of your test suite to catch things like this. There are many different scripts available to do this, and I've definitely caught real bugs when using them in the past.
I don't have the test suite fully working on my computer (even on master), but all of these changes are fairly safe and I think Travis should build it when I submit this PR.