You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2012/04/13 19:27:39 UTC

[4/4] git commit: Perform check for required software before starting build

Perform check for required software before starting build


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/commit/0c304ee4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/tree/0c304ee4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/diff/0c304ee4

Branch: refs/heads/master
Commit: 0c304ee4a1ca43538b3c3904c8b2bff5fa1e376f
Parents: 97006d7
Author: macdonst <si...@gmail.com>
Authored: Fri Apr 13 12:32:14 2012 -0400
Committer: macdonst <si...@gmail.com>
Committed: Fri Apr 13 12:32:14 2012 -0400

----------------------------------------------------------------------
 coho |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/0c304ee4/coho
----------------------------------------------------------------------
diff --git a/coho b/coho
index c0a1b1b..e1095bf 100755
--- a/coho
+++ b/coho
@@ -3,6 +3,7 @@ VERSION = process.argv[2]
 var util           = require('util')
 ,   exec           = require('child_process').exec
 ,   fs			   = require('fs')
+,   sys            = require('sys')
 ,   ios            = 'https://git-wip-us.apache.org/repos/asf/incubator-cordova-ios.git'
 ,   blackberry     = 'https://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks.git'
 ,   android        = 'https://git-wip-us.apache.org/repos/asf/incubator-cordova-android.git'
@@ -34,6 +35,8 @@ var util           = require('util')
 var commandQueue = [],
     child;
 
+var requiredSoftware = ["git", "jodoc", "markdown"];
+
 function queueCommand(cmd) {
     commandQueue.push(cmd);
 }
@@ -63,6 +66,24 @@ function executeCommands(callback) {
     }
 }
 
+function checkSoftware() {
+    var sw = requiredSoftware.shift();
+    if (sw) {
+        console.log(sw);
+		child = exec("which " + sw, function (error, stdout, stderr) {
+            if (stdout === "") {
+                console.log(sw + ' not found. Please install ' + sw + ' before continuing.');
+                process.exit(0);
+            }
+            checkSoftware();
+        });
+    } else {
+        console.log("All required software installed");
+    }
+}
+
+checkSoftware();
+
 queueCommand("rm -rf temp && mkdir temp && cd temp && mkdir repositories && mkdir release");
 queueCommand("cd temp/release && mkdir bin && mkdir src && cd bin && mkdir ios && mkdir android && mkdir blackberry && mkdir windows && mkdir webos && mkdir symbian && mkdir bada");