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/06/04 23:24:57 UTC

wp7 commit: Allow app names with spaces

Updated Branches:
  refs/heads/2.8.x 064be0e1b -> cb2d243d3


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/cb2d243d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp7/tree/cb2d243d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp7/diff/cb2d243d

Branch: refs/heads/2.8.x
Commit: cb2d243d3510cd1d0a71f863bf01268bd247e420
Parents: 064be0e
Author: Benn Mapes <be...@gmail.com>
Authored: Fri May 24 18:01:19 2013 -0700
Committer: Benn Mapes <be...@gmail.com>
Committed: Tue Jun 4 14:19:44 2013 -0700

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


http://git-wip-us.apache.org/repos/asf/cordova-wp7/blob/cb2d243d/bin/create.js
----------------------------------------------------------------------
diff --git a/bin/create.js b/bin/create.js
index 2e82d7d..93236f8 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