Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/guysoft/OctoPi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Sheffer <guysoft@gmail.com>2015-04-04 13:12:30 +0300
committerGuy Sheffer <guysoft@gmail.com>2015-04-04 13:12:30 +0300
commit8c8e4fe649c9733e08a24c26a35c4963781f0034 (patch)
tree74b64aa124fdacf7dfdc905c3a1b9a7f2c1332f0
parent2bc3729780e54a1aa2df4878aaa398b06374584e (diff)
Fix if condition and also #74
-rwxr-xr-xsrc/common.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/common.sh b/src/common.sh
index b388d76..03ba9e1 100755
--- a/src/common.sh
+++ b/src/common.sh
@@ -14,10 +14,13 @@ function restoreLd(){
}
function gitclone(){
-if [ $GIT_REPO_OVERRIDE != "" ] ; then
+if [ "$GIT_REPO_OVERRIDE" != "" ] ; then
REPO=$GIT_REPO_OVERRIDE`echo $1 | awk -F '/' '{print $(NF)}'`
sudo -u pi git clone $REPO
- sudo -u pi git remote set-url $1
+ REPO_DIR_NAME=$(echo ${REPO} | 's%^.*/\([^/]*\)\.git$%\1%g')
+ pushd ${REPO_DIR_NAME}
+ sudo -u pi git remote set-url $1
+ popd
else
sudo -u pi git clone $1
fi