From 32b4770dab53a65e96e2231f4441d6e3a0d87fd4 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Mon, 15 May 2017 17:40:15 +0900 Subject: [PATCH] Use `sed -E` instead of `-r` `-E` is more widely supported, including GNU sed. - [GNU sed](https://www.gnu.org/software/sed/manual/sed.html) - [macOS](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/sed.1.html) - [FreeBSD](https://man.freebsd.org/sed/) - [NetBSD](http://netbsd.gw.com/cgi-bin/man-cgi?sed) - [OpenBSD](http://man.openbsd.org/sed.1) --- src/_yarn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_yarn b/src/_yarn index 1947437..7d2ba86 100644 --- a/src/_yarn +++ b/src/_yarn @@ -76,13 +76,13 @@ _global_commands=( _yarn_commands_scripts() { local -a scripts - scripts=($(yarn run --json 2>/dev/null | sed -r '/Commands available|possibleCommands/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g;s/,/\n/g')) + scripts=($(yarn run --json 2>/dev/null | sed -E '/Commands available|possibleCommands/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g;s/,/\n/g')) _describe 'command or script' _commands -- _global_commands -- scripts } _yarn_scripts() { local -a scripts - scripts=($(yarn run --json 2>/dev/null | sed -r '/Commands available|possibleCommands/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g;s/,/\n/g')) + scripts=($(yarn run --json 2>/dev/null | sed -E '/Commands available|possibleCommands/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g;s/,/\n/g')) _describe 'script' scripts }