diff options
| author | Shulhan <ms@kilabit.info> | 2023-07-15 17:22:25 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-07-15 17:22:25 +0700 |
| commit | 6f7aefd6bce7819d2334d24c0ad7d757a0c09ff5 (patch) | |
| tree | bd88fda0d7e32de9960a1fb80a99d644ac490b84 /gcloud-image-cleanup.aww | |
| parent | d55c4bee9ac3b31d79426b121eeb106ba2b002a8 (diff) | |
| download | compute-archlinux-image-builder-6f7aefd6bce7819d2334d24c0ad7d757a0c09ff5.tar.xz | |
gcloud-image-cleanup: add option "--no-run-if-empty" when running xargs
Without this option, if the input is empty, the command will fail.
Diffstat (limited to 'gcloud-image-cleanup.aww')
| -rw-r--r-- | gcloud-image-cleanup.aww | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gcloud-image-cleanup.aww b/gcloud-image-cleanup.aww index 1b90679..49411e6 100644 --- a/gcloud-image-cleanup.aww +++ b/gcloud-image-cleanup.aww @@ -10,10 +10,9 @@ cat current-images.txt gcloud compute images list \ --no-standard-images \ - --show-deprecated \ --format="value(NAME)" \ | head --lines=-5 \ - | xargs gcloud compute images delete --quiet + | xargs --no-run-if-empty gcloud compute images delete --quiet gcloud compute images list \ --no-standard-images \ |
