aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.bashrc_distr
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-08-13 23:38:11 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2016-08-13 23:38:11 +0200
commit1bc5eea5274881a299da19ff5df1c7ddc61cbe93 (patch)
treede2c6c9c9ae633c50941ffb244ffea91185e21a3 /.bashrc_distr
parent.ghci: add :hoogle (diff)
downloadlinux-home-1bc5eea5274881a299da19ff5df1c7ddc61cbe93.tar.gz
linux-home-1bc5eea5274881a299da19ff5df1c7ddc61cbe93.zip
fix ShellCheck warnings
Diffstat (limited to '')
-rw-r--r--.bashrc_distr17
1 files changed, 14 insertions, 3 deletions
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() {