summaryrefslogtreecommitdiffstats
path: root/radar-base.sh
diff options
context:
space:
mode:
authorSteven Hall <Hallzy.18@gmail.com>2015-10-16 11:31:21 -0700
committerSteven Hall <Hallzy.18@gmail.com>2015-10-16 11:41:34 -0700
commitb8797284031edbfd4c22f19f4878418cf4b2ec10 (patch)
treec34fb18605023a564a8a9c116ba654b253c91cc6 /radar-base.sh
parent9e46dc2520728237e48f9fea879b85601a3aebf3 (diff)
downloadgit-sonar-b8797284031edbfd4c22f19f4878418cf4b2ec10.tar.gz
git-sonar-b8797284031edbfd4c22f19f4878418cf4b2ec10.zip
Made changes recommeneded by @michaeldfallen
in fetch.sh "if" now checks for $@ instead of just $1 in radar-base.sh there is now a parameter expansion on line 170 instead of the if statements. in git-radar, now there is a shift, and a regex check that the next value is a number. If the next value after --fetch_t is not a number, an error is echo'd and it resorts to the default behaviour of 5 minutes.
Diffstat (limited to '')
-rwxr-xr-xradar-base.sh7
1 files changed, 1 insertions, 6 deletions
diff --git a/radar-base.sh b/radar-base.sh
index ee5fa00..886a6e9 100755
--- a/radar-base.sh
+++ b/radar-base.sh
@@ -167,12 +167,7 @@ time_to_update() {
}
fetch() {
- if [ -z "$1" ]; then
- # Default 5 minutes
- local timeToUpdate="$((5 * 60))"
- else
- local timeToUpdate="$1"
- fi
+ local timeToUpdate = ${"$1":-"$((5 * 60))"}
if time_to_update $timeToUpdate; then
record_timestamp