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/06/11 01:42:55 UTC

[06/12] wp7 commit: Allow app names with spaces

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

Branch: refs/heads/master
Commit: 68774921cf23b7a88de0a964276b2bca6a54ed80
Parents: 00e1297
Author: Benn Mapes <be...@gmail.com>
Authored: Fri May 24 18:01:19 2013 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Jun 7 20:40:26 2013 -0700

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


http://git-wip-us.apache.org/repos/asf/cordova-wp7/blob/68774921/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