fish_config: Pick a python

Also remove a use of `eval` and `string escape`.

Fixes #3970.
This commit is contained in:
Fabian Homborg 2017-04-20 13:37:27 +02:00
parent 7ef2d5e86f
commit e410d47565

View file

@ -1,9 +1,10 @@
function fish_config --description "Launch fish's web based configuration" function fish_config --description "Launch fish's web based configuration"
# Support passing an initial tab like "colors" or "functions" set -lx __fish_bin_dir $__fish_bin_dir
set -l initial_tab if command -sq python3
if count $argv >/dev/null python3 "$__fish_datadir/tools/web_config/webconfig.py" $argv
set initial_tab $argv[1] else if command -sq python2
python2 "$__fish_datadir/tools/web_config/webconfig.py" $argv
else if command -sq python
python "$__fish_datadir/tools/web_config/webconfig.py" $argv
end end
set -x __fish_bin_dir $__fish_bin_dir
eval (string escape $__fish_datadir/tools/web_config/webconfig.py) $initial_tab
end end