mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +00:00
parent
7cd9c3b2bf
commit
0c2d939e02
1 changed files with 10 additions and 0 deletions
|
@ -64,6 +64,16 @@ complete -f -c yarn -n '__fish_seen_subcommand_from publish' -l tag
|
|||
complete -f -c yarn -n '__fish_use_subcommand' -a remove
|
||||
complete -f -c yarn -n '__fish_use_subcommand' -a run
|
||||
|
||||
function __fish_yarn_run
|
||||
if test -e package.json; and type -q jq
|
||||
jq -r '.scripts | to_entries | map("\(.key)\t\(.value | tostring | .[0:20])") | .[]' package.json
|
||||
else if type -q jq
|
||||
command yarn run --json 2> /dev/null | jq -r '.data.hints? | to_entries | map("\(.key)\t\(.value | tostring |.[0:20])") | .[]'
|
||||
end
|
||||
end
|
||||
|
||||
complete -f -c yarn -n '__fish_seen_subcommand_from run' -a "(__fish_yarn_run)"
|
||||
|
||||
complete -f -c yarn -n '__fish_use_subcommand' -a tag
|
||||
complete -f -c yarn -n '__fish_seen_subcommand_from tag' -a 'add rm ls'
|
||||
|
||||
|
|
Loading…
Reference in a new issue