You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by be...@apache.org on 2013/08/28 23:10:36 UTC

android commit: Added commit 150cdfd, override arg for project template

Updated Branches:
  refs/heads/master b1d878850 -> 57bed98cf


Added commit 150cdfd, override arg for project template

Conflicts:
	bin/create


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

Branch: refs/heads/master
Commit: 57bed98cf17d600f8f6f6624e67f66c3b91af9d9
Parents: b1d8788
Author: Benn Mapes <be...@gmail.com>
Authored: Wed Aug 28 13:59:10 2013 -0700
Committer: Benn Mapes <be...@gmail.com>
Committed: Wed Aug 28 14:04:43 2013 -0700

----------------------------------------------------------------------
 bin/create        | 2 +-
 bin/lib/create.js | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/57bed98c/bin/create
----------------------------------------------------------------------
diff --git a/bin/create b/bin/create
index 29c129b..4ebc184 100755
--- a/bin/create
+++ b/bin/create
@@ -47,7 +47,7 @@ function create() {
                       args[2] == 'help' || args[2] == '-help' || args[2] == '/help')) {
       create.help();
   } else {
-      create.run(args[2], args[3], args[4]);
+      create.run(args[2], args[3], args[4], args[5]);
       process.exit(0);
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/57bed98c/bin/lib/create.js
----------------------------------------------------------------------
diff --git a/bin/lib/create.js b/bin/lib/create.js
index f27132b..6afbf89 100755
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -35,17 +35,20 @@ var shell = require('shelljs'),
  *   - `project_path` 	{String} Path to the new Cordova android project.
  *   - `package_name`{String} Package name, following reverse-domain style convention.
  *   - `project_name` 	{String} Project name.
+ *   - 'project_template_dir' {String} Path to project template (override).
  */
 
-module.exports.run = function(project_path, package_name, project_name) {
+module.exports.run = function(project_path, package_name, project_name, project_template_dir) {
 
     var VERSION = fs.readFileSync(path.join(ROOT, 'VERSION'), 'utf-8');
-    var project_template_dir = path.join(ROOT, 'bin', 'templates', 'project');
 
     // Set default values for path, package and name
     project_path = typeof project_path !== 'undefined' ? project_path : "CordovaExample";
     package_name = typeof package_name !== 'undefined' ? package_name : 'my.cordova.project';
     project_name = typeof project_name !== 'undefined' ? project_name : 'CordovaExample';
+    project_template_dir = typeof project_template_dir !== 'undefined' ? 
+                           project_template_dir : 
+                           path.join(ROOT, 'bin', 'templates', 'project');
 
     var safe_activity_name = project_name.replace(/\W/, '');
     var package_as_path = package_name.replace(/\./g, path.sep);