Merge pull request #41933 from ixdy/list-resources-grep

list-resources: don't fail if the grep fails to match any resources
This commit is contained in:
Saad Ali
2017-02-22 16:14:32 -08:00
committed by GitHub

View File

@@ -49,7 +49,7 @@ function gcloud-compute-list() {
while true; do while true; do
if result=$(gcloud compute ${resource} list --project=${PROJECT} ${@:2}); then if result=$(gcloud compute ${resource} list --project=${PROJECT} ${@:2}); then
if [[ ! -z "${GREP_REGEX}" ]]; then if [[ ! -z "${GREP_REGEX}" ]]; then
result=$(echo "${result}" | grep "${GREP_REGEX}") result=$(echo "${result}" | grep "${GREP_REGEX}" || true)
fi fi
echo "${result}" echo "${result}"
return return