From 1bc5eea5274881a299da19ff5df1c7ddc61cbe93 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 13 Aug 2016 23:38:11 +0200 Subject: fix ShellCheck warnings --- .bashrc_distr | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to '.bashrc_distr') diff --git a/.bashrc_distr b/.bashrc_distr index 10df5b2..6534378 100644 --- a/.bashrc_distr +++ b/.bashrc_distr @@ -1,13 +1,24 @@ -[ ! -z "${BASHRC_DISTR+x}" ] && return || readonly BASHRC_DISTR=1 +#!/usr/bin/env bash + +if [ -n "${BASHRC_DISTR+x}" ]; then + return 0 +else + readonly BASHRC_DISTR=1 +fi checksums_path='sha1sums.txt' update_checksums() { - sha1sum "$@" > "$checksums_path" + sha1sum -- "$@" > "$checksums_path" } update_checksums_distr() { - update_checksums *.exe *.iso + local -a paths=() + local path + while IFS= read -r -d $'\0' path; do + paths+=("$path") + done < <( find . -type f -\( -iname '*.exe' -o -iname '*.iso' -\) -print0 ) + update_checksums "${paths[@]+"${paths[@]}"}" } verify_checksums() { -- cgit v1.2.3