summaryrefslogtreecommitdiff
path: root/archrelease.in
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2017-05-05 18:41:09 -0400
committerJan Alexander Steffens (heftig) <jan.steffens@gmail.com>2017-07-05 18:21:56 +0200
commita396a6908110a860a89a1e640153bac1e0da2a57 (patch)
treed568adf0637e0247173ccefddf391bb23e4fc7f5 /archrelease.in
parent78fabcfa0694ae8c81e1d5ec0e5dacaed533545e (diff)
downloaddevtools32-a396a6908110a860a89a1e640153bac1e0da2a57.tar.xz
Make slightly more involved changes to make shellcheck happy.
- Use `read -r` instead of other forms of read or looping - Use arrays instead of strings with whitespaces. - In one instance, use ${var%%.*} instead of $(echo $var|cut -f. -d1)
Diffstat (limited to 'archrelease.in')
-rw-r--r--archrelease.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/archrelease.in b/archrelease.in
index 2ba9d48..6b4f1be 100644
--- a/archrelease.in
+++ b/archrelease.in
@@ -38,7 +38,7 @@ trunk=${PWD##*/}
# Normally this should be trunk, but it may be something
# such as 'gnome-unstable'
IFS='/' read -r -d '' -a parts <<< "$PWD"
-if [[ "${parts[@]:(-2):1}" == "repos" ]]; then
+if [[ "${parts[*]:(-2):1}" == "repos" ]]; then
die 'archrelease: Should not be in repos dir (try from trunk/)'
fi
unset parts
@@ -67,7 +67,7 @@ for tag in "$@"; do
while read -r file; do
trash+=("repos/$tag/$file")
done < <(svn ls "repos/$tag")
- [[ $trash ]] && svn rm -q "${trash[@]/%/@}"
+ [[ ${#trash[@]} == 0 ]] || svn rm -q "${trash[@]/%/@}"
else
mkdir -p "repos/$tag"
svn add --parents -q "repos/$tag"