Don't call external uname when $OSTYPE will do#1911
Merged
NoahGorny merged 10 commits intoBash-it:masterfrom Aug 14, 2021
Merged
Don't call external uname when $OSTYPE will do#1911NoahGorny merged 10 commits intoBash-it:masterfrom
uname when $OSTYPE will do#1911NoahGorny merged 10 commits intoBash-it:masterfrom
Conversation
uname when $OSTYPE will douname when $OSTYPE will do
Contributor
Author
|
This PR should probably be "squashed" when merged, no need for 11 commits when 1 will do. |
Alsö, use `[[` instead of `[` as the former has less insane argument handling being shell syntax rather than a builtin command that must emulate being a real binary
Alsö, use `[[` instead of `[`.
gaelicWizard
added a commit
to gaelicWizard/bash-it
that referenced
this pull request
Aug 15, 2021
* lib/helpers: use `$OSTYPE` instead of `$(uname)` * plugins/osx: use `$OSTYPE` instead of `$(uname)` * plugins/boot2docker: use `$OSTYPE` instead of `$(uname)` * plugins/python: use `$OSTYPE` instead of `$(uname)` * plugins/base: use `$OSTYPE` instead of `$(uname)` Alsö, use `[[` instead of `[` as the former has less insane argument handling being shell syntax rather than a builtin command that must emulate being a real binary * completion/brew: use `$OSTYPE` instead of `$(uname)` * completion/git: use `$OSTYPE` instead of `$(uname)` Alsö, use `[[` instead of `[`. * completion/fabric: use `$OSTYPE` instead of `uname` * theme/demula: use `$OSTYPE` instead of `$(uname)` * theme/rana: use `$OSTYPE` instead of `$(uname)`
catull
pushed a commit
to catull/bash-it
that referenced
this pull request
Oct 21, 2021
* lib/helpers: use `$OSTYPE` instead of `$(uname)` * plugins/osx: use `$OSTYPE` instead of `$(uname)` * plugins/boot2docker: use `$OSTYPE` instead of `$(uname)` * plugins/python: use `$OSTYPE` instead of `$(uname)` * plugins/base: use `$OSTYPE` instead of `$(uname)` Alsö, use `[[` instead of `[` as the former has less insane argument handling being shell syntax rather than a builtin command that must emulate being a real binary * completion/brew: use `$OSTYPE` instead of `$(uname)` * completion/git: use `$OSTYPE` instead of `$(uname)` Alsö, use `[[` instead of `[`. * completion/fabric: use `$OSTYPE` instead of `uname` * theme/demula: use `$OSTYPE` instead of `$(uname)` * theme/rana: use `$OSTYPE` instead of `$(uname)`
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.
Description
The only use case for invoking the
unamebinary in our usage is to find out if we're on Darwin or Linux or whatnot.$OSTYPEis a shell builtin constant that tells us this, so use it.Motivation and Context
I'm on a bit of a crusade to reduce launching external programs and to make use of constants and features already provided by Bash. This is Bash It, after all!
How Has This Been Tested?
Types of changes
More of an optimization than a fix...
Checklist:
clean_files.txtand formatted it usinglint_clean_files.sh.