aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2015-10-21 11:37:33 -0700
committerKenny Root <kenny@the-b.org>2015-10-21 11:37:35 -0700
commit0b4542c535e14c09b0341021d82ec444642e7e04 (patch)
treee55c55f54a4f45661fcdb038b712a8aebe315c23 /scripts
parent0d5194f4db059a50aa253458631f1f2410f15e86 (diff)
downloadconnectbot-0b4542c535e14c09b0341021d82ec444642e7e04.tar.gz
connectbot-0b4542c535e14c09b0341021d82ec444642e7e04.tar.bz2
connectbot-0b4542c535e14c09b0341021d82ec444642e7e04.zip
Quote all files in check-lint-results.bash
To prevent premature variable expansion, word-splitting, and globbing quote all the things that could be affected by these problems.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check-lint-count.bash18
1 files changed, 9 insertions, 9 deletions
diff --git a/scripts/check-lint-count.bash b/scripts/check-lint-count.bash
index 0397477..901eded 100755
--- a/scripts/check-lint-count.bash
+++ b/scripts/check-lint-count.bash
@@ -21,37 +21,37 @@ fi
if [[ ! -f $historical_file ]]; then \
# no cache history, store this one and exit
- cp $lint_file $historical_file
+ cp "$lint_file" "$historical_file"
exit 0
fi
tmp_dir="$(mktemp -d lint.XXXXXXXX)"
-trap "rm -rf $tmp_dir" ERR EXIT
+trap 'rm -rf $tmp_dir' ERR EXIT
lint_results="$tmp_dir/lint.txt"
hist_results="$tmp_dir/hist.txt"
run_query() {
local xqilla_script='string-join(//issue/location/(concat("file=", @file, " line=", @line, " column=", @column, " reason=", ../@summary)), "&#10;")'
- xqilla -i $1 <(echo $xqilla_script) | sed "s,$PWD/,,g" > $2
+ xqilla -i "$1" <(echo "$xqilla_script") | sed "s,$PWD/,,g" > "$2"
}
-run_query $lint_file $lint_results
-run_query $historical_file $hist_results
+run_query "$lint_file" "$lint_results"
+run_query "$historical_file" "$hist_results"
-old_count=$(cat $hist_results | wc -l)
-new_count=$(cat $lint_results | wc -l)
+old_count=$(wc -l < "$hist_results")
+new_count=$(wc -l < "$lint_results")
echo "Historical count: $old_count, new count: $new_count"
if [[ $new_count > $old_count ]]; then \
echo "FAILURE: lint issues increased from $old_count to $new_count"
- diff -u $hist_results $lint_results
+ diff -u "$hist_results" "$lint_results"
exit 2
fi
if [[ $TRAVIS_PULL_REQUEST == false ]]; then \
# Okay, we either stayed the same or reduced our number.
# Write it out so we can check it next build!
- cp $lint_file $historical_file
+ cp "$lint_file" "$historical_file"
fi