Check valid python more strictly in shell entry point#258
Open
syjung6967 wants to merge 2 commits intoiipeace:masterfrom
syjung6967:patch-1
Open
Check valid python more strictly in shell entry point#258syjung6967 wants to merge 2 commits intoiipeace:masterfrom syjung6967:patch-1
syjung6967 wants to merge 2 commits intoiipeace:masterfrom
syjung6967:patch-1
Conversation
iipeace
reviewed
May 19, 2021
| @@ -1,3 +1,5 @@ | |||
| #!/usr/bin/env bash | |||
Owner
There was a problem hiding this comment.
Why did you restrict the shell to bash?
It will cause error on systems without bash.
There are also various shells such as dochsh, dash, rbash, rsh...
iipeace
reviewed
May 19, 2021
| # any later version. | ||
|
|
||
| # check valid Python in order: user-specified, python, python3 and 2 # | ||
| PYTHON=`which $PYTHON || which python || which python3 || which python2` |
iipeace
reviewed
May 19, 2021
|
|
||
| # check valid Python in order: user-specified, python, python3 and 2 # | ||
| PYTHON=`which $PYTHON || which python || which python3 || which python2` | ||
| if [ z`$PYTHON -V 2>/dev/null | cut -d' ' -f1` != "zPython" ] |
Owner
There was a problem hiding this comment.
How about using regular expressions instead of external commands like cut?
a53d579 to
71e37f9
Compare
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.
-Voption