Updating git remote check to use remote string from argument
This commit is contained in:
@@ -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}
|
git remote show $remote > /dev/null 2>&1
|
||||||
else
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user