From 22a9e783c99b56db688793ad3736bd1e3fc20f40 Mon Sep 17 00:00:00 2001 From: Jonathan Warner Date: Mon, 12 Nov 2018 03:51:44 -0700 Subject: 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. --- start-wekan.sh | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'start-wekan.sh') 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 -- cgit v1.2.3-1-g7c22