diff --git a/share/completions/bower.fish b/share/completions/bower.fish index a32226738..f9fa011da 100644 --- a/share/completions/bower.fish +++ b/share/completions/bower.fish @@ -52,7 +52,7 @@ function __bower_list_installed if set -l python (__fish_anypython) # Warning: That weird indentation is necessary, because python. - $python -c 'import json, sys; data = json.load(sys.stdin); + $python -S -c 'import json, sys; data = json.load(sys.stdin); for k,v in data["dependencies"].items(): print(k + "\t" + v[:18])' bower.json 2>/dev/null return end diff --git a/share/completions/composer.fish b/share/completions/composer.fish index b441970eb..7b7107e1a 100644 --- a/share/completions/composer.fish +++ b/share/completions/composer.fish @@ -31,7 +31,7 @@ data = json.load(json_data) json_data.close() packages = itertools.chain(data['require'].keys(), data['require-dev'].keys()) print(\"\n\".join(packages)) - " | $python + " | $python -S end function __fish_composer_installed_packages @@ -48,7 +48,7 @@ for package in data['packages']: for package in data['packages-dev']: installed_packages.append(package['name']) print(\"\n\".join(installed_packages)) -" | $python +" | $python -S end function __fish_composer_scripts @@ -61,7 +61,7 @@ data = json.load(json_data) json_data.close() if 'scripts' in data and data['scripts']: print(\"\n\".join(data['scripts'].keys())) -" | $python +" | $python -S end # add cmds list diff --git a/share/completions/npm.fish b/share/completions/npm.fish index 2a1139625..01cf46086 100644 --- a/share/completions/npm.fish +++ b/share/completions/npm.fish @@ -91,7 +91,7 @@ function __fish_npm_run # npm is dog-slow and might check for updates online! if test -e package.json; and set -l python (__fish_anypython) # Warning: That weird indentation is necessary, because python. - $python -c 'import json, sys; data = json.load(sys.stdin); + $python -S -c 'import json, sys; data = json.load(sys.stdin); for k,v in data["scripts"].items(): print(k + "\t" + v[:18])' /dev/null else if command -sq jq; and test -e package.json jq -r '.scripts | to_entries | map("\(.key)\t\(.value | tostring | .[0:20])") | .[]' package.json diff --git a/share/completions/yarn.fish b/share/completions/yarn.fish index 0829ede78..7c9da9eb0 100644 --- a/share/completions/yarn.fish +++ b/share/completions/yarn.fish @@ -73,7 +73,7 @@ complete -f -c yarn -n '__fish_use_subcommand' -a run function __fish_yarn_run if test -e package.json; and set -l python (__fish_anypython) # Warning: That weird indentation is necessary, because python. - $python -c 'import json, sys; data = json.load(sys.stdin); + $python -S -c 'import json, sys; data = json.load(sys.stdin); for k,v in data["scripts"].items(): print(k + "\t" + v[:18])' /dev/null else if test -e package.json; and type -q jq jq -r '.scripts | to_entries | map("\(.key)\t\(.value | tostring | .[0:20])") | .[]' package.json diff --git a/share/functions/fish_npm_helper.fish b/share/functions/fish_npm_helper.fish index 4686b3475..e822db602 100644 --- a/share/functions/fish_npm_helper.fish +++ b/share/functions/fish_npm_helper.fish @@ -58,7 +58,7 @@ function __yarn_installed_packages end if set -l python (__fish_anypython) - $python -c 'import json, sys; data = json.load(sys.stdin); + $python -S -c 'import json, sys; data = json.load(sys.stdin); print("\n".join(data["dependencies"])); print("\n".join(data["devDependencies"]))' <$package_json 2>/dev/null else if type -q jq jq -r '.dependencies as $a1 | .devDependencies as $a2 | ($a1 + $a2) | to_entries[] | .key' $package_json