Updating git remote check to use remote string from argument

This commit is contained in:
Jake Herbst
2022-05-20 12:37:06 -04:00
parent 24e20fb438
commit 7a58b1cc54
+4 -2
View File
@@ -12,9 +12,11 @@ branch="main"
while getopts ":r:b:" o; do while getopts ":r:b:" o; do
case "${o}" in case "${o}" in
r) r)
if git remote show $remote &>/dev/null;then
remote=${OPTARG} remote=${OPTARG}
else git remote show $remote > /dev/null 2>&1
ret_val=$?
if [ $ret_val -ne 0 ]; then
echo "Error: remote '$remote' not found. Add the upstream remote to your repository and try again." echo "Error: remote '$remote' not found. Add the upstream remote to your repository and try again."
exit 1 exit 1
fi fi