Commit 9b12e372 authored by Saad Ali's avatar Saad Ali Committed by GitHub

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

list-resources: don't fail if the grep fails to match any resources
parents 2e127111 eeec9393
...@@ -49,7 +49,7 @@ function gcloud-compute-list() { ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment