Browse Source

Updated install to not overwrite config if already in place

spesk1 4 years ago
parent
commit
17e640f990
1 changed files with 13 additions and 0 deletions
  1. 13 0
      install.sh

+ 13 - 0
install.sh

@@ -1,6 +1,7 @@
 #!/bin/bash
 
 installDir="$HOME/.local/bin/"
+sgDir="$HOME/.sg"
 libDir="/usr/local/lib/SimplyGit/"
 
 if [ ! -d $installDir ]; then
@@ -13,8 +14,20 @@ if [ ! -d $libDir ]; then
 	sudo mkdir -p $libDir
 fi
 
+if [ ! -d $sgDir ]; then
+	echo "Making $sgDir"
+	mkdir -p $sgDir
+fi
+
 echo "Copying bin"
 cp ./sg $installDir
 
+if [ ! -f $sgDir/sg.config ]; then
+	echo "Copying default config"
+	cp ./example.config $sgDir/sg.config
+else
+	echo "Found config file not overwriting"
+fi
+
 echo "Calling sudo to copy libs"
 sudo cp ./lib/SimplyGit/* $libDir