From 96374f4e5400d1132703927b32db22981fa27886 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 27 Jul 2018 14:00:01 +0200 Subject: [PATCH] only install synapse and riot if directory is not already there --- riot/install.sh | 13 ++++++++++--- synapse/install.sh | 9 ++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/riot/install.sh b/riot/install.sh index 22bb87f03e..43b39611d7 100644 --- a/riot/install.sh +++ b/riot/install.sh @@ -1,13 +1,20 @@ RIOT_BRANCH=master BASE_DIR=$(realpath $(dirname $0)) -pushd $BASE_DIR +if [[ -d $BASE_DIR/riot-web ]]; then + echo "riot is already installed" + exit +fi + + +pushd $BASE_DIR > /dev/null curl -L https://github.com/vector-im/riot-web/archive/${RIOT_BRANCH}.zip --output riot.zip unzip riot.zip rm riot.zip mv riot-web-${RIOT_BRANCH} riot-web cp config-template/config.json riot-web/ -pushd riot-web +pushd riot-web > /dev/null npm install npm run build -popd \ No newline at end of file +popd > /dev/null +popd > /dev/null diff --git a/synapse/install.sh b/synapse/install.sh index 47f1f746fc..959e529e6b 100644 --- a/synapse/install.sh +++ b/synapse/install.sh @@ -6,7 +6,14 @@ CONFIG_TEMPLATE=consent PORT=8008 # set current directory to script directory BASE_DIR=$(realpath $(dirname $0)) -pushd $BASE_DIR + +if [[ -d $BASE_DIR/$SERVER_DIR ]]; then + echo "synapse is already installed" + exit +fi + +pushd $BASE_DIR > /dev/null + mkdir -p installations/ curl https://codeload.github.com/matrix-org/synapse/zip/$SYNAPSE_BRANCH --output synapse.zip unzip synapse.zip