cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bennma...@apache.org
Subject [7/9] wp7 commit: Allow app names with spaces
Date Mon, 03 Jun 2013 18:36:26 GMT
Allow app names with spaces


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

Branch: refs/heads/3.0.0
Commit: 1514fef383a7256c03448fd6192ff222f8aa05f8
Parents: 996f864
Author: Benn Mapes <benn.mapes@gmail.com>
Authored: Fri May 24 18:01:19 2013 -0700
Committer: Benn Mapes <benn.mapes@gmail.com>
Committed: Mon Jun 3 11:34:53 2013 -0700

----------------------------------------------------------------------
 bin/create.js |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-wp7/blob/1514fef3/bin/create.js
----------------------------------------------------------------------
diff --git a/bin/create.js b/bin/create.js
index 7d89d0a..d8b67a9 100644
--- a/bin/create.js
+++ b/bin/create.js
@@ -171,11 +171,12 @@ function create(path, namespace, name) {
     replaceInFile(path + "\\MainPage.xaml",/\$safeprojectname\$/g,namespace);
     replaceInFile(path + "\\MainPage.xaml.cs",/\$safeprojectname\$/g,namespace);
     replaceInFile(path + "\\CordovaAppProj.csproj",/\$safeprojectname\$/g,namespace);
-    if (NAME != "CordovaAppProj") {
-        replaceInFile(path + "\\CordovaSolution.sln",/CordovaAppProj/g,NAME);
+    if (name != "CordovaAppProj") {
+        var valid_name = name.replace(/(\.\s|\s\.|\s+|\.+)/g, '_');
+        replaceInFile(path + "\\CordovaSolution.sln", /CordovaAppProj/g, valid_name);
         // rename project and solution
-        exec('%comspec% /c ren ' + path + "\\CordovaSolution.sln " + NAME + '.sln');
-        exec('%comspec% /c ren ' + path + "\\CordovaAppProj.csproj " + NAME + '.csproj');
+        exec('%comspec% /c ren ' + path + "\\CordovaSolution.sln " + valid_name + '.sln');
+        exec('%comspec% /c ren ' + path + "\\CordovaAppProj.csproj " + valid_name + '.csproj');
     }
 
     //copy .dll if necessary


Mime
View raw message