Fix a git error message from ./sp-tools.sh init

Fix a git error message from ./sp-tools.sh init

diff --git a/sp-tools.sh b/sp-tools.sh
index a6bfa65..c31b3a5 100755
--- a/sp-tools.sh
+++ b/sp-tools.sh
@@ -357,13 +357,18 @@ Init_Subcommand() {
 
   git submodule update --init --recursive
 
+  cd $ENGINEPATH
+  ENGINE_GIT_REMOTES=$(git remote)
+  for i in $ENGINE_GIT_REMOTES
+  do
+    if [ $i = "upstream" ]; then
+      git remote remove upstream
+    fi
+  done
+
   if [[ $(git config --get remote.origin.url) == git* ]];  then
-    cd $ENGINEPATH
-    git remote remove upstream
     git remote add upstream git@github.com:TheDushan/OpenWolf-Engine.git
   else
-    cd $ENGINEPATH
-    git remote remove upstream
     git remote add upstream https://github.com/TheDushan/OpenWolf-Engine.git
   fi
 

GitHub
sha: 80d05baf

© GrangerHub. All rights reserved. Tremulous © Darklegion Development. Granger by err-overflow and MoP licensed CC-BY-SA-2.5