From 2004146b78ad7881d3f0a1763dbb1cdc7e097cd1 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Mon, 26 Sep 2022 23:50:00 +0200 Subject: [PATCH] Fix adding remote during upgrade --- scripts/upgrade | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index f02b22b..1f0dbe1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -111,7 +111,10 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]; then if [ ! `git rev-parse --is-inside-work-tree &> /dev/null` ]; then # If current install is not a Git repo then init one git init --quiet - git remote add origin $repo_url + if ! git config remote.origin.url > /dev/null; then + # If remote does not exist, add it + git remote add origin $repo_url + fi git fetch origin --quiet git checkout -b stable --track origin/stable --force --quiet fi @@ -125,7 +128,10 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]; then if [ ! `git rev-parse --is-inside-work-tree &> /dev/null` ]; then # If current install is not a Git repo then init one git init --quiet - git remote add origin $addons_repo_url + if ! git config remote.origin.url > /dev/null; then + # If remote does not exist, add it + git remote add origin $addons_repo_url + fi git fetch origin --quiet git checkout -b stable --track origin/stable --force --quiet fi