cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject android commit: CB-1961 update to create script for android/windows
Date Wed, 30 Jan 2013 22:57:56 GMT
Updated Branches:
  refs/heads/master 3610bbf21 -> 77f9cae50


CB-1961 update to create script for android/windows


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/77f9cae5
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/77f9cae5
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/77f9cae5

Branch: refs/heads/master
Commit: 77f9cae50b0b36800b48a01fa2dd597a957a1718
Parents: 3610bbf
Author: Anis Kadri <anis.kadri@gmail.com>
Authored: Wed Jan 30 14:57:49 2013 -0800
Committer: Anis Kadri <anis.kadri@gmail.com>
Committed: Wed Jan 30 14:57:49 2013 -0800

----------------------------------------------------------------------
 bin/create.js |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/77f9cae5/bin/create.js
----------------------------------------------------------------------
diff --git a/bin/create.js b/bin/create.js
index 258c32c..d0d9999 100644
--- a/bin/create.js
+++ b/bin/create.js
@@ -33,12 +33,22 @@ function read(filename) {
     f.Close();
     return s;
 }
+
+function checkTargets(targets) {
+    if(!targets) {
+        WScript.Echo("You do not have any android targets setup. Please create at least one
target with the `android` command");
+        WScript.Quit(69);
+    }
+}
+
 function setTarget() {
     var targets = shell.Exec('android.bat list targets').StdOut.ReadAll().match(/id:\s\d+/g);
+    checkTargets(targets);
     return targets[targets.length - 1].replace(/id: /, ""); // TODO: give users the option
to set their target 
 }
 function setApiLevel() {
     var targets = shell.Exec('android.bat list targets').StdOut.ReadAll().match(/API level:\s\d+/g);
+    checkTargets(targets);
     return targets[targets.length - 1].replace(/API level: /, "");
 }
 function write(filename, contents) {


Mime
View raw message