-
Notifications
You must be signed in to change notification settings - Fork 92
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
Check valid python more strictly in shell entry point #258
base: master
Are you sure you want to change the base?
Conversation
@@ -1,3 +1,5 @@ | |||
#!/usr/bin/env bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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...
@@ -10,14 +10,11 @@ | |||
# any later version. | |||
|
|||
# check valid Python in order: user-specified, python, python3 and 2 # | |||
PYTHON=`which $PYTHON || which python || which python3 || which python2` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks nice! :)
@@ -10,14 +10,11 @@ | |||
# any later version. | |||
|
|||
# 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" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using regular expressions instead of external commands like cut?
a53d579
to
71e37f9
Compare
-V
option