Просмотр исходного кода

Merge pull request #1547 from shearer12345/JS-CHECK-FOR-MONO-DIRECTORY

Check for `/usr/bin/mono/` directory
JoshEngebretson 8 лет назад
Родитель
Сommit
1787d2a373
2 измененных файлов с 15 добавлено и 1 удалено
  1. 2 0
      AUTHORS.md
  2. 13 1
      Build/Scripts/BuildConfig.js

+ 2 - 0
AUTHORS.md

@@ -53,6 +53,8 @@
 
 - Manuel Freiberger (https://github.com/ombre5733)
 
+- John Shearer (https://github.com/shearer12345)
+
 ### Contribution Copyright and Licensing
 
 Atomic Game Engine contribution copyrights are held by their authors.  Each author retains the copyright to their contribution and agrees to irrevocably license the contribution under the Atomic Game Engine Contribution License `CONTRIBUTION_LICENSE.md`.  Please see `CONTRIBUTING.md` for more details.

+ 13 - 1
Build/Scripts/BuildConfig.js

@@ -16,6 +16,18 @@ function programFileExists(filePath)
     }
 }
 
+// checks to see if a folder exists
+function programDirectoryExists(filePath)
+{
+    try
+    {
+        return fs.statSync(filePath).isDirectory();
+    }
+    catch (err)
+    {
+        return false;
+    }
+}
 
 function processOptions(config) {
 
@@ -33,7 +45,7 @@ function processOptions(config) {
             if ( spawnSync)
                 config["with-atomicnet"] = spawnSync("which", ["xbuild"]).status == 1 ? false : true;
         } else if (os.platform() == "linux") {  // see if xbuild is available on linux
-            config["with-atomicnet"] = programFileExists('/usr/bin/xbuild');
+            config["with-atomicnet"] = programFileExists('/usr/bin/xbuild') && programDirectoryExists('/usr/bin/mono/');
         }
 	}