From 01612f71bf3ec8cc11e51dfd7473b37bfdd19891 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 18 Jul 2018 18:04:31 +0200 Subject: [PATCH] dont assume current directory in scripts --- riot/install.sh | 4 ++++ riot/start.sh | 5 ++++- riot/stop.sh | 5 ++++- synapse/start.sh | 3 +++ synapse/stop.sh | 3 +++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/riot/install.sh b/riot/install.sh index 3729c3c03a..2eedf0fefa 100644 --- a/riot/install.sh +++ b/riot/install.sh @@ -1,4 +1,7 @@ RIOT_BRANCH=master + +BASE_DIR=$(realpath $(dirname $0)) +pushd $BASE_DIR curl -L https://github.com/vector-im/riot-web/archive/${RIOT_BRANCH}.zip --output riot.zip unzip riot.zip rm riot.zip @@ -6,3 +9,4 @@ mv riot-web-${RIOT_BRANCH} riot-web pushd riot-web npm install npm run build +popd \ No newline at end of file diff --git a/riot/start.sh b/riot/start.sh index 6e9ad218e1..2eb3221511 100644 --- a/riot/start.sh +++ b/riot/start.sh @@ -1,5 +1,8 @@ +BASE_DIR=$(realpath $(dirname $0)) +pushd $BASE_DIR pushd riot-web/webapp/ python -m SimpleHTTPServer 8080 & PID=$! popd -echo $PID > riot.pid \ No newline at end of file +echo $PID > riot.pid +popd \ No newline at end of file diff --git a/riot/stop.sh b/riot/stop.sh index d0a0d69502..ca1da23476 100644 --- a/riot/stop.sh +++ b/riot/stop.sh @@ -1,3 +1,6 @@ +BASE_DIR=$(realpath $(dirname $0)) +pushd $BASE_DIR PIDFILE=riot.pid kill $(cat $PIDFILE) -rm $PIDFILE \ No newline at end of file +rm $PIDFILE +popd \ No newline at end of file diff --git a/synapse/start.sh b/synapse/start.sh index dec9a7d035..6d758630a4 100644 --- a/synapse/start.sh +++ b/synapse/start.sh @@ -1,4 +1,7 @@ +BASE_DIR=$(realpath $(dirname $0)) +pushd $BASE_DIR pushd installations/consent source env/bin/activate ./synctl start +popd popd \ No newline at end of file diff --git a/synapse/stop.sh b/synapse/stop.sh index 916e774a99..ab376d8ac5 100644 --- a/synapse/stop.sh +++ b/synapse/stop.sh @@ -1,4 +1,7 @@ +BASE_DIR=$(realpath $(dirname $0)) +pushd $BASE_DIR pushd installations/consent source env/bin/activate ./synctl stop +popd popd \ No newline at end of file