summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlo Sala <carlosalag@protonmail.com>2022-01-12 12:19:34 +0100
committerGitHub <noreply@github.com>2022-01-12 12:19:34 +0100
commit93cea53618ebd3f108275c88c948f790492337b4 (patch)
treebe5c1862b38a2e3ff0c39e9601a478eac2ae9ee0
parentb4819557618bbf8452c612f614ad824d243bb376 (diff)
downloadzsh-93cea53618ebd3f108275c88c948f790492337b4.tar.gz
zsh-93cea53618ebd3f108275c88c948f790492337b4.tar.bz2
zsh-93cea53618ebd3f108275c88c948f790492337b4.zip
fix(yarn): update completion (#10579)
Fixes #10578
-rw-r--r--plugins/yarn/_yarn4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/yarn/_yarn b/plugins/yarn/_yarn
index 9db02602e..1237ba672 100644
--- a/plugins/yarn/_yarn
+++ b/plugins/yarn/_yarn
@@ -116,7 +116,7 @@ _yarn_commands_scripts() {
fi
if [[ -n $packageJson ]]; then
- scripts=($(cat "$packageJson" | perl -0777 -MJSON::PP -n -E '%r=decode_json($_); say for sort keys %{$r->{scripts}}'))
+ scripts=($(cat "$packageJson" | perl -0777 -MJSON::PP -n -E '$r=decode_json($_); do{($k=$_)=~s/:/\\:/g;say $k}for sort keys %{$r->{scripts}}'))
fi
_describe 'command or script' _commands -- _global_commands -- scripts -- binaries
@@ -144,7 +144,7 @@ _yarn_scripts() {
fi
if [[ -n $packageJson ]]; then
- scripts=("${(@f)$(cat ${packageJson} | perl -0777 -MJSON::PP -n -E '%r=%{decode_json($_)->{scripts}}; printf "$_:$r{$_}\n" for sort keys %r')}")
+ scripts=("${(@f)$(cat ${packageJson} | perl -0777 -MJSON::PP -n -E '%r=%{decode_json($_)->{scripts}}; do{$k=$_;($e=$k)=~s/:/\\:/g; printf "$e:$r{$k}\n"} for sort keys %r')}")
fi
commands=('env' $scripts $binaries)