From 3b713427c07f042852c826efb0010e4bb3404b0c Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 14 Aug 2016 11:42:56 +0200 Subject: set -o errexit -o nounset -o pipefail in functions --- .bashrc_distr | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to '.bashrc_distr') diff --git a/.bashrc_distr b/.bashrc_distr index a680b6b..f573653 100644 --- a/.bashrc_distr +++ b/.bashrc_distr @@ -12,14 +12,18 @@ update_checksums() { sha1sum -- "$@" > "$checksums_path" } -update_checksums_distr() { +update_checksums_distr() ( + set -o errexit -o nounset -o pipefail + local -a paths local path + while IFS= read -d '' -r path; do paths+=("$path") done < <( find . -type f -\( -iname '*.exe' -o -iname '*.iso' -\) -print0 ) + update_checksums "${paths[@]+"${paths[@]}"}" -} +) verify_checksums() { sha1sum --check "$checksums_path" -- cgit v1.2.3