You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2013/09/28 01:48:04 UTC

git commit: minor code cleanup of create script

Updated Branches:
  refs/heads/3.1.x 7e7b49734 -> 8c71425ca


minor code cleanup of create script


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

Branch: refs/heads/3.1.x
Commit: 8c71425ca13b6d332c76aa24d72f7319c413ddd3
Parents: 7e7b497
Author: purplecabbage <pu...@gmail.com>
Authored: Fri Sep 27 16:47:36 2013 -0700
Committer: purplecabbage <pu...@gmail.com>
Committed: Fri Sep 27 16:47:36 2013 -0700

----------------------------------------------------------------------
 windows8/bin/create.js | 28 +++++++---------------------
 1 file changed, 7 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/8c71425c/windows8/bin/create.js
----------------------------------------------------------------------
diff --git a/windows8/bin/create.js b/windows8/bin/create.js
index 4604ed0..2428cb4 100644
--- a/windows8/bin/create.js
+++ b/windows8/bin/create.js
@@ -36,8 +36,8 @@ var args = WScript.Arguments,
     TEMPLATES_PATH = '\\template',
     // default template to use when creating the project
     CREATE_TEMPLATE = TEMPLATES_PATH,
-    PROJECT_PATH, 
-    PACKAGE, 
+    PROJECT_PATH,
+    PACKAGE,
     NAME,
     GUID;
 
@@ -115,8 +115,8 @@ function exec_verbose(command) {
 //generate guid for the project
 function genGuid() {
     var TypeLib = WScript.CreateObject("Scriptlet.TypeLib");
-    strGuid = TypeLib.Guid.split("}")[0]; // there is extra crap after the } that is causing file streams to break, probably an EOF ... 
-    strGuid = strGuid.replace(/[\{\}]/g,""); 
+    strGuid = TypeLib.Guid.split("}")[0]; // there is extra crap after the } that is causing file streams to break, probably an EOF ...
+    strGuid = strGuid.replace(/[\{\}]/g,"");
     return strGuid;
 }
 
@@ -146,28 +146,14 @@ function create(destPath, namespace, name, guid) {
     fso.CopyFolder(srcPath,destPath);
     var newProjGuid = guid || genGuid();
 
-    // replace the guid in the AppManifest
+    // replace the guid in the AppManifest and deploy script
     replaceInFile(destPath + "\\package.appxmanifest","$guid1$",newProjGuid);
-    // replace safe-project-name in AppManifest
+    replaceInFile(destPath + "\\cordova\\lib\\deploy.js","$guid1$",newProjGuid);
 
+    // replace $safeprojectname$ and $projectname$ in AppManifest
     replaceInFile(destPath + "\\package.appxmanifest",/\$safeprojectname\$/g,safeProjectName);
     replaceInFile(destPath + "\\package.appxmanifest",/\$projectname\$/g,name);
 
-    replaceInFile(destPath + "\\cordova\\lib\\deploy.js","$guid1$",newProjGuid);
-
-    // replaceInFile(srcPath + "\\App.xaml",/\$safeprojectname\$/g,namespace);
-    // replaceInFile(srcPath + "\\App.xaml.cs",/\$safeprojectname\$/g,namespace);
-
-    // replaceInFile(srcPath + "\\MainPage.xaml",/\$safeprojectname\$/g,namespace);
-    // replaceInFile(srcPath + "\\MainPage.xaml.cs",/\$safeprojectname\$/g,namespace);
-    // replaceInFile(srcPath + "\\CordovaAppProj.csproj",/\$safeprojectname\$/g,namespace);
-    // if (NAME != "CordovaAppProj") {
-    //     var valid_name = NAME.replace(/(\.\s|\s\.|\s+|\.+)/g, '_');
-    //     replaceInFile(srcPath + "\\CordovaSolution.sln", /CordovaAppProj/g, valid_name);
-    //     // rename project and solution
-    //     exec('%comspec% /c ren ' + srcPath + "\\CordovaSolution.sln " + valid_name + '.sln');
-    //     exec('%comspec% /c ren ' + srcPath + "\\CordovaAppProj.csproj " + valid_name + '.csproj');
-    // }
 
     // cleanup