Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions guider/guider
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks nice! :)

if [ z`$PYTHON -V 2>/dev/null | cut -d' ' -f1` != "zPython" ]

Copy link
Copy Markdown
Owner

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?

then
PYTHON=`which python || which python3 || which python2`
if [ z`$PYTHON -V 2>/dev/null | cut -d' ' -f1` != "zPython" ]
then
echo "[Error] fail to find python"
exit
fi
echo "[Error] fail to find python"
exit
fi

# export CMDLINE for Guider #
Expand Down