cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bra...@apache.org
Subject [1/2] git commit: Remove --www parameter from --prepare, infer from platform instead.
Date Wed, 17 Apr 2013 18:09:03 GMT
Updated Branches:
  refs/heads/future 05fd6bde3 -> 0da1172a4


Remove --www parameter from --prepare, infer from platform instead.


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

Branch: refs/heads/future
Commit: a3307fc69a7b799fb46b1413536c0f5e3353bb8f
Parents: 3a6777a
Author: Braden Shepherdson <braden.shepherdson@gmail.com>
Authored: Wed Apr 17 14:08:18 2013 -0400
Committer: Braden Shepherdson <braden.shepherdson@gmail.com>
Committed: Wed Apr 17 14:08:18 2013 -0400

----------------------------------------------------------------------
 README.md               |    2 +-
 platforms/android.js    |    5 +++++
 platforms/blackberry.js |    5 +++++
 platforms/ios.js        |    5 +++++
 plugman.js              |    8 ++++----
 5 files changed, 20 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/a3307fc6/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 02d4674..2850726 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ List plugins:
 
 Prepare project:
 
-    plugman --prepare --platform <ios|android|bb10> --project <directory> --www
<directory> [--plugins_dir <directory>]
+    plugman --prepare --platform <ios|android|bb10> --project <directory> [--plugins_dir
<directory>]
 
 `--plugins_dir` defaults to `<project>/cordova/plugins`, but can be any directory containing
a subdirectory for each fetched plugin
 

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/a3307fc6/platforms/android.js
----------------------------------------------------------------------
diff --git a/platforms/android.js b/platforms/android.js
index e5ccd0b..b4a38b3 100644
--- a/platforms/android.js
+++ b/platforms/android.js
@@ -209,3 +209,8 @@ function pluginInstalled(plugin_et, project_dir, config_xml_filename)
{
     return (fs.readFileSync(path.resolve(project_dir, config_xml_filename), 'utf8')
            .match(new RegExp(plugin_name, "g")) != null);
 }
+
+exports.www_dir = function(project_dir) {
+    return path.join(project_dir, 'assets', 'www');
+};
+

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/a3307fc6/platforms/blackberry.js
----------------------------------------------------------------------
diff --git a/platforms/blackberry.js b/platforms/blackberry.js
index 231aacc..05156b5 100644
--- a/platforms/blackberry.js
+++ b/platforms/blackberry.js
@@ -165,3 +165,8 @@ function pluginInstalled(plugin_et, project_dir) {
     return (fs.readFileSync(path.resolve(project_dir, 'config.xml'), 'utf8')
            .match(new RegExp(plugin_name, "g")) != null);
 }
+
+exports.www_dir = function(project_dir) {
+    return path.join(project_dir, 'www');
+};
+

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/a3307fc6/platforms/ios.js
----------------------------------------------------------------------
diff --git a/platforms/ios.js b/platforms/ios.js
index de7ffaf..84a4307 100644
--- a/platforms/ios.js
+++ b/platforms/ios.js
@@ -363,3 +363,8 @@ function updateConfig(action, config_path, plugin_et) {
 function checkLastCommand() {
     if(shell.error() != null) throw {name: "ShellError", message: shell.error()};
 }
+
+exports.www_dir = function(project_dir) {
+    return path.join(project_dir, 'www');
+};
+

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/a3307fc6/plugman.js
----------------------------------------------------------------------
diff --git a/plugman.js b/plugman.js
index 701660d..ebee8c3 100755
--- a/plugman.js
+++ b/plugman.js
@@ -46,7 +46,6 @@ var known_opts = { 'platform' : [ 'ios', 'android', 'blackberry' ]
             , 'debug' : Boolean
             , 'prepare' : Boolean
             , 'plugins': path
-            , 'www': path
             , 'link': Boolean
             , 'variable' : Array
             }, shortHands = { 'var' : 'variable' };
@@ -82,8 +81,9 @@ else if (cli_opts.list) {
       }
     });
 }
-else if (cli_opts.prepare && cli_opts.project && cli_opts.www) {
-    plugin_loader.handlePrepare(cli_opts.project, plugins_dir, cli_opts.www, cli_opts.platform);
+else if (cli_opts.prepare && cli_opts.project) {
+    var www_dir = platform_modules[cli_opts.platform].www_dir(cli_opts.project);
+    plugin_loader.handlePrepare(cli_opts.project, plugins_dir, www_dir, cli_opts.platform);
 }
 else if (cli_opts.remove) {
     removePlugin(cli_opts.plugin);
@@ -117,7 +117,7 @@ function printUsage() {
     console.log('Uninstall a plugin:\n\t' + package.name + ' --uninstall --platform <'+
platforms +'> --project <directory> --plugin <name> [--plugins_dir <directory>]\n');
     console.log('Delete the local copy of a plugin:\n\t' + package.name + ' --remove --plugin
<name> [--plugins_dir <directory>]\n');
     console.log('List plugins:\n\t' + package.name + ' --list [--plugins_dir <directory>]\n');
-    console.log('Prepare project:\n\t' + package.name + ' --prepare --platform <ios|android|bb10>
--project <directory> --www <directory> [--plugins_dir <directory>]');
+    console.log('Prepare project:\n\t' + package.name + ' --prepare --platform <ios|android|bb10>
--project <directory> [--plugins_dir <directory>]');
     console.log('\n\t--plugins_dir defaults to <project>/cordova/plugins, but can be
any directory containing a subdirectory for each plugin');
 }
 


Mime
View raw message