From 7ef2d5e86fb8dc75a6fc316a7a7cc5400709bcfa Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Thu, 20 Apr 2017 13:35:20 +0200 Subject: [PATCH] fish_update_completions: Pick a python This removes a need for packagers to either patch our shebangs or pick a particular python. This was already done in __fish_config_interactive (where we need to duplicate the code because it involves backgrounding). Work towards #3970. --- share/functions/fish_update_completions.fish | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/share/functions/fish_update_completions.fish b/share/functions/fish_update_completions.fish index 0fb007983..136927356 100644 --- a/share/functions/fish_update_completions.fish +++ b/share/functions/fish_update_completions.fish @@ -1,4 +1,11 @@ function fish_update_completions --description "Update man-page based completions" # Clean up old paths - python -B $__fish_datadir/tools/create_manpage_completions.py --manpath --progress --cleanup-in '~/.config/fish/completions' --cleanup-in '~/.config/fish/generated_completions' + set -l update_args -B $__fish_datadir/tools/create_manpage_completions.py --manpath --cleanup-in '~/.config/fish/completions' --cleanup-in '~/.config/fish/generated_completions' --progress + if command -qs python3 + python3 $update_args + else if command -qs python2 + python2 $update_args + else if command -qs python + python $update_args + end end