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
Add termux support for fish_config. #6248
Conversation
share/tools/web_config/webconfig.py
Outdated
@@ -49,6 +49,10 @@ def is_wsl(): | |||
return True | |||
return False | |||
|
|||
def is_termux(): | |||
""" Return whether we are running under the Terumx application for Android""" |
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.
Terumx
-> Termux
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.
fixed
share/tools/web_config/webconfig.py
Outdated
@@ -49,6 +49,10 @@ def is_wsl(): | |||
return True | |||
return False | |||
|
|||
def is_termux(): | |||
""" Return whether we are running under the Terumx application for Android""" | |||
return 'com.termux' in os.environ['PATH'] and 0 == os.system('which termux-open-url 1>&2 2>/dev/null') |
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.
which termux-open-url 1>&2 2>/dev/null
will send stdout to stderr and stderr to /dev/null
.
If you want to discard both, swap the order of the redirection operators.
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.
fixed
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.
Also this check itself is really quite.... unclean, and invokes another shell and the which
command, which doesn't have to be installed and should be discouraged (in shell scripts, use command -v
).
I'd suggest distutils.spawn.find_executable('termux-open-url')
, which returns a path if it finds it and None if it doesn't.
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.
using distutils
instead of which
df3e012
to
f55462f
Compare
f55462f
to
a1d85ef
Compare
This looks much nicer now. Merged, thanks! |
No description provided.