From fb9766fe5f73803188cca39850d892c25f6f5178 Mon Sep 17 00:00:00 2001 From: joachimschmidt557 Date: Sun, 3 Nov 2019 17:04:28 +0100 Subject: [PATCH] Better without subshell --- src | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src b/src index 72ea010..7a04c54 100755 --- a/src +++ b/src @@ -19,7 +19,7 @@ gitrepo() { git clone "$1" "$2" updated="$updated $2" else - ( cd "$2" && git pull ) + git -C "$2" pull fi } @@ -71,21 +71,21 @@ parse() { esac } -case "$@" in - --help) - usage - exit 1 - ;; - --version) - echo "src version 0.1.0" - exit 1 - ;; - "") - ;; - *) - echo "Invalid command line args" - exit 1 - ;; -esac +for arg in "$@" ; do + case "$arg" in + --help) + usage + exit 1 + ;; + --version) + echo "src version 0.1.0" + exit 1 + ;; + *) + echo "Invalid command line args" + exit 1 + ;; + esac +done parse