Explorar o código

Merge pull request #25521 from allencloud/modify-vendor-script

better vendor.sh to break when fail in grep
Vincent Demeester %!s(int64=9) %!d(string=hai) anos
pai
achega
92da332638
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      hack/vendor.sh

+ 6 - 1
hack/vendor.sh

@@ -19,7 +19,12 @@ case $# in
 	;;
 	;;
 # If user passed arguments to the script
 # If user passed arguments to the script
 1)
 1)
-	eval "$(grep -E "^clone [^ ]+ $1" "$0")"
+	path="$PWD/hack/vendor.sh"
+	if ! cloneGrep="$(grep -E "^clone [^ ]+ $1" "$path")"; then
+		echo >&2 "error: failed to find 'clone ... $1' in $path"
+		exit 1
+	fi
+	eval "$cloneGrep"
 	clean
 	clean
 	exit 0
 	exit 0
 	;;
 	;;