From 37486f336ef8991fa7d943207cced637f0711f71 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 7 Mar 2018 16:57:53 -0500 Subject: [PATCH] fix/simplify gitget, dunno what i was thinking --- gitget | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/gitget b/gitget index a61c114..5199898 100755 --- a/gitget +++ b/gitget @@ -38,23 +38,11 @@ REPO_DIR is, or will become the root of the repo." local workingdir local orig_dir="$PWD" local ret - if [[ $1 == *[^/].git ]]; then - if [[ $2 ]]; then - workingdir="$2" - else - workingdir="${1##*/}" - workingdir="${workingdir%.git}" - fi - elif (( $# == 2 )); then - echo error: 2 arguments given but the first does not end in .git - echo "$help" - return 1 + if [[ $2 ]]; then + workingdir="$2" else - workingdir="$1" - if [[ ! -d $workingdir/.git ]]; then - echo "error: expected $workingdir/.git to exist" - return 1 - fi + workingdir="${1##*/}" + workingdir="${workingdir%.git}" fi [[ -d $workingdir ]] || mkdir -p "$workingdir" cd "$workingdir" -- 2.30.2