]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Add checks to the scripts (they has to be executed at the root of the
authorChocobozzz <florian.bigard@gmail.com>
Tue, 24 Nov 2015 08:53:27 +0000 (09:53 +0100)
committerChocobozzz <florian.bigard@gmail.com>
Tue, 24 Nov 2015 08:53:27 +0000 (09:53 +0100)
project)

scripts/clean_test.sh
scripts/run_servers.sh

index e46b5ecd5e467c420b35e35de7c068aab7a4602e..ef146e09160cb138cd066cfca7a9d54be05ef29c 100755 (executable)
@@ -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
index f99ca6bd90a86e4fd982c3c201fdec7edb5d1810..83768178c0bec9346dc4d606ce1e46d0daf26a3a 100755 (executable)
@@ -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 &