da3b8fcb6a6bcf4d440b9768d2deab27f787929a
- Author
- Lukas Elmer <lukas.elmer@gmail.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
fix(yarn): output completion entries in UTF-8 (#11955)
Diff
1diff --git a/plugins/yarn/_yarn b/plugins/yarn/_yarn
2index 1237ba672daae0211f1ad192c8db7d97df3ee520..f15756ff45922f5a3c4c29835dc4747afc626c59 100644
3--- a/plugins/yarn/_yarn
4+++ b/plugins/yarn/_yarn
5@@ -144,7 +144,7 @@ _yarn_scripts() {
6 fi
7
8 if [[ -n $packageJson ]]; then
9- 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')}")
10+ scripts=("${(@f)$(cat ${packageJson} | perl -0777 -MJSON::PP -n -E 'binmode(STDOUT, ":encoding(UTF-8)"); %r=%{decode_json($_)->{scripts}}; do{$k=$_;($e=$k)=~s/:/\\:/g; printf "$e:$r{$k}\n"} for sort keys %r')}")
11 fi
12
13 commands=('env' $scripts $binaries)