From 24e20fb438a1d000a9f1bf97214126a19e8305fe Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Fri, 20 May 2022 10:04:06 -0400 Subject: [PATCH] This needs a proper test to work --- scripts/update_birdnet.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/update_birdnet.sh b/scripts/update_birdnet.sh index f7fc305..bea167b 100755 --- a/scripts/update_birdnet.sh +++ b/scripts/update_birdnet.sh @@ -12,13 +12,12 @@ branch="main" while getopts ":r:b:" o; do case "${o}" in r) - remote=${OPTARG} - - # Ensure that git remote is configured - git remote show $remote > /dev/null 2>&1 || { + if git remote show $remote &>/dev/null;then + remote=${OPTARG} + else echo "Error: remote '$remote' not found. Add the upstream remote to your repository and try again." exit 1 - } + fi ;; b) branch=${OPTARG}