cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [04/13] git commit: bin/run: use optimist node module for option parsing
Date Thu, 30 Jan 2014 23:25:28 GMT
bin/run: use optimist node module for option parsing


Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/537927d8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/537927d8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/537927d8

Branch: refs/heads/master
Commit: 537927d8f47113b9018c20fd1efa61121bfebdb7
Parents: 5996eb9
Author: Maxim Ermilov <maxim.ermilov@canonical.com>
Authored: Mon Dec 23 18:30:12 2013 +0400
Committer: Maxim Ermilov <maxim.ermilov@canonical.com>
Committed: Mon Dec 23 18:30:12 2013 +0400

----------------------------------------------------------------------
 bin/build/run    | 4 +++-
 bin/create       | 1 +
 bin/package.json | 3 ++-
 3 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/537927d8/bin/build/run
----------------------------------------------------------------------
diff --git a/bin/build/run b/bin/build/run
index 7a7b282..09a91e5 100755
--- a/bin/build/run
+++ b/bin/build/run
@@ -24,5 +24,7 @@ var platform = require('./lib/ubuntu');
 var root = path.resolve();
 var www = path.join(root, 'www');
 
-platform.run(root, process.argv.indexOf('--device') == -1, process.argv.indexOf('--debug')
!= -1);
+var argv = require('optimist').boolean(['device', 'debug']).argv;
+
+platform.run(root, !argv.device, argv.debug);
 

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/537927d8/bin/create
----------------------------------------------------------------------
diff --git a/bin/create b/bin/create
index 17397fe..3399672 100755
--- a/bin/create
+++ b/bin/create
@@ -56,6 +56,7 @@ function create(project_path, package_name, project_name, project_template_dir)
         require.resolve("shelljs");
         require.resolve("elementtree");
         require.resolve("colors");
+        require.resolve("optimist");
         create_project();
     } catch(e) {
         console.log('Shelljs module was not found, running \'npm install\'.....');

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/537927d8/bin/package.json
----------------------------------------------------------------------
diff --git a/bin/package.json b/bin/package.json
index 956d442..c3991fc 100644
--- a/bin/package.json
+++ b/bin/package.json
@@ -20,7 +20,8 @@
     "dependencies": {
         "shelljs": "0.2.6",
         "elementtree": "*",
-        "colors": "0.6.2"
+        "colors": "0.6.2",
+        "optimist": "0.6.0"
     },
     "devDependencies": {
     },


Mime
View raw message