Don't fail if the grep fails to match any resources

This commit is contained in:
Jeff Grafton 2017-02-22 14:55:57 -08:00
parent e43e663a53
commit eeec939361

View File

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