only install synapse and riot if directory is not already there

This commit is contained in:
Bruno Windels 2018-07-27 14:00:01 +02:00
parent a4e7b14728
commit 96374f4e54
2 changed files with 18 additions and 4 deletions

View file

@ -1,13 +1,20 @@
RIOT_BRANCH=master RIOT_BRANCH=master
BASE_DIR=$(realpath $(dirname $0)) 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 curl -L https://github.com/vector-im/riot-web/archive/${RIOT_BRANCH}.zip --output riot.zip
unzip riot.zip unzip riot.zip
rm riot.zip rm riot.zip
mv riot-web-${RIOT_BRANCH} riot-web mv riot-web-${RIOT_BRANCH} riot-web
cp config-template/config.json riot-web/ cp config-template/config.json riot-web/
pushd riot-web pushd riot-web > /dev/null
npm install npm install
npm run build npm run build
popd popd > /dev/null
popd > /dev/null

View file

@ -6,7 +6,14 @@ CONFIG_TEMPLATE=consent
PORT=8008 PORT=8008
# set current directory to script directory # set current directory to script directory
BASE_DIR=$(realpath $(dirname $0)) 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/ mkdir -p installations/
curl https://codeload.github.com/matrix-org/synapse/zip/$SYNAPSE_BRANCH --output synapse.zip curl https://codeload.github.com/matrix-org/synapse/zip/$SYNAPSE_BRANCH --output synapse.zip
unzip synapse.zip unzip synapse.zip