summaryrefslogtreecommitdiffstats
path: root/start-wekan.sh
diff options
context:
space:
mode:
authorJonathan Warner <warnerjon12@gmail.com>2018-11-12 03:51:44 -0700
committerJonathan Warner <warnerjon12@gmail.com>2018-11-12 05:45:51 -0700
commit22a9e783c99b56db688793ad3736bd1e3fc20f40 (patch)
tree85bc85d372a7c1f9e9bdfe3ee5530273a02f0157 /start-wekan.sh
parentd4e75165dde4977f8354170d4367a4c5213b122c (diff)
downloadwekan-22a9e783c99b56db688793ad3736bd1e3fc20f40.tar.gz
wekan-22a9e783c99b56db688793ad3736bd1e3fc20f40.tar.bz2
wekan-22a9e783c99b56db688793ad3736bd1e3fc20f40.zip
Revised shell scripts to check for wekan repository
The scripts used to assume that ~/repos/wekan was a local wekan repo. They now check that the active directory is a wekan repo.
Diffstat (limited to 'start-wekan.sh')
-rwxr-xr-xstart-wekan.sh26
1 files changed, 22 insertions, 4 deletions
diff --git a/start-wekan.sh b/start-wekan.sh
index 6006fb92..3584ac6d 100755
--- a/start-wekan.sh
+++ b/start-wekan.sh
@@ -1,7 +1,25 @@
-# If you want to restart even on crash, uncomment while and done lines.
+#!/bin/bash
+
+function wekan_repo_check(){
+ git_remotes="$(git remote show 2>/dev/null)"
+ res=""
+ for i in $git_remotes; do
+ res="$(git remote get-url $i | sed 's/.*wekan\/wekan.*/wekan\/wekan/')"
+ if [[ "$res" == "wekan/wekan" ]]; then
+ break
+ fi
+ done
+ if [[ "$res" != "wekan/wekan" ]]; then
+ echo "$PWD is not a wekan repository"
+ exit;
+ fi
+}
+
+# If you want to restart even on crash, uncomment while and done lines.
#while true; do
- cd ~/repos/wekan/.build/bundle
+ wekan_repo_check
+ cd .build/bundle
#export MONGO_URL='mongodb://127.0.0.1:27019/wekantest'
#export MONGO_URL='mongodb://127.0.0.1:27019/wekan'
export MONGO_URL='mongodb://127.0.0.1:27019/wekantest'
@@ -18,6 +36,6 @@
export PORT=2000
#export LDAP_ENABLE=true
node main.js
- # & >> ~/repos/wekan.log
- cd ~/repos
+ # & >> ../../wekan.log
+ cd ../..
#done