From b0bad566a4c475919be857abc25433c10076f346 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Fri, 1 Apr 2022 22:21:36 +0300 Subject: vagrant-update-all-boxes.sh: best practices --- %HOME%/.local/bin/vagrant-update-all-boxes.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to '%HOME%/.local/bin') diff --git a/%HOME%/.local/bin/vagrant-update-all-boxes.sh b/%HOME%/.local/bin/vagrant-update-all-boxes.sh index e433c16..06b2360 100755 --- a/%HOME%/.local/bin/vagrant-update-all-boxes.sh +++ b/%HOME%/.local/bin/vagrant-update-all-boxes.sh @@ -6,6 +6,7 @@ # Distributed under the MIT License. set -o errexit -o nounset -o pipefail +shopt -s inherit_errexit dump() { local msg @@ -42,10 +43,13 @@ update_box_from_line() { } update_all_boxes() { + local output + output="$( vagrant box outdated --global | grep -F outdated )" + local line while IFS= read -r line; do update_box_from_line "$line" - done < <( vagrant box outdated --global | grep -F outdated ) + done <<< "$output" } clean_old_boxes() { -- cgit v1.2.3