From b8797284031edbfd4c22f19f4878418cf4b2ec10 Mon Sep 17 00:00:00 2001 From: Steven Hall Date: Fri, 16 Oct 2015 11:31:21 -0700 Subject: 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. --- radar-base.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'radar-base.sh') 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 -- cgit v1.2.3