From ecef65b6050f53e90e2239dd593706189ef8f03d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 24 Nov 2015 09:53:27 +0100 Subject: [PATCH] Add checks to the scripts (they has to be executed at the root of the project) --- scripts/clean_test.sh | 4 +++- scripts/run_servers.sh | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/clean_test.sh b/scripts/clean_test.sh index e46b5ecd5..ef146e091 100755 --- a/scripts/clean_test.sh +++ b/scripts/clean_test.sh @@ -1,6 +1,8 @@ #!/bin/bash +basePath=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) + for i in $(seq 1 6); do printf "use peertube-test%s;\ndb.dropDatabase();" "$i" | mongo - rm -rf "./test$i" + rm -rf "$basePath/../test$i" done diff --git a/scripts/run_servers.sh b/scripts/run_servers.sh index f99ca6bd9..83768178c 100755 --- a/scripts/run_servers.sh +++ b/scripts/run_servers.sh @@ -1,5 +1,10 @@ #!/bin/bash +if [ ! -f server.js ]; then + echo "The script has to be executed at the root of the project." + exit -1 +fi + NODE_ENV=test NODE_APP_INSTANCE=1 node server.js & sleep 1 NODE_ENV=test NODE_APP_INSTANCE=2 node server.js &