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.
This commit is contained in:
Jonathan Warner 2018-11-12 03:51:44 -07:00
parent d4e75165dd
commit 22a9e783c9
4 changed files with 33 additions and 11 deletions

View file

@ -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