Kaynağa Gözat

Build scripts (#112)

* add 'checking if mongodb is online' in build scripts.

* fix build script exit value.
Melonpi 8 yıl önce
ebeveyn
işleme
7a7d9c890a
2 değiştirilmiş dosya ile 26 ekleme ve 0 silme
  1. 13 0
      build_and_run.bat
  2. 13 0
      build_and_run.sh

+ 13 - 0
build_and_run.bat

@@ -1,4 +1,17 @@
 @echo off
+where mongo
+IF %ERRORLEVEL% NEQ 0 (
+    echo "mongo command is not available, please make sure mongodb is installed and added to the system path."
+    exit /b 1
+)
+
+mongo --eval "db.stats()"
+IF %ERRORLEVEL% NEQ 0 (
+    echo "mongodb not running"
+    exit /b 1
+) else (
+    echo "mongodb is online..."
+)
 
 echo building MineCase...
 pushd src

+ 13 - 0
build_and_run.sh

@@ -1,4 +1,17 @@
 #!/bin/bash
+which mongo
+if [ $? -ne 0 ]; then
+    echo "mongo command is not available, please make sure mongodb is installed and added to the system path."
+    return 1
+fi
+
+mongo --eval "db.stats()"
+if [ $? -ne 0 ]; then
+    echo "mongodb not running"
+    return 1
+else 
+    echo "mongodb is online..."
+fi
 
 echo building MineCase...
 cd src