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 2014/09/19 01:16:30 UTC
[2/4] git commit: CB-7494 Fixes wrong replacements in *.appxmanifest
files
CB-7494 Fixes wrong replacements in *.appxmanifest files
Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/fdce7411
Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/fdce7411
Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/fdce7411
Branch: refs/heads/master
Commit: fdce7411529e3630f6b7c17f9942a3113ba67c6e
Parents: 1a80ff8
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Mon Sep 8 18:36:40 2014 +0400
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Mon Sep 8 18:43:09 2014 +0400
----------------------------------------------------------------------
windows/bin/lib/create.js | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/fdce7411/windows/bin/lib/create.js
----------------------------------------------------------------------
diff --git a/windows/bin/lib/create.js b/windows/bin/lib/create.js
index ddfaeb8..44f722b 100644
--- a/windows/bin/lib/create.js
+++ b/windows/bin/lib/create.js
@@ -37,7 +37,9 @@ module.exports.run = function (argv) {
}
var packageName = args.argv.remain[1] || "Cordova.Example",
appName = args.argv.remain[2] || "CordovaAppProj",
- safeAppName = appName.replace(/(\.\s|\s\.|\s+|\.+)/g, '_'),
+ // 64 symbols restriction goes from manifest schema definition
+ // http://msdn.microsoft.com/en-us/library/windows/apps/br211415.aspx
+ safeAppName = appName.length <= 64 ? appName : appName.substr(0, 64),
templateOverrides = args.argv.remain[3],
guid = args['guid'] || uuid.v1(),
root = path.join(__dirname, '..', '..');
@@ -66,8 +68,8 @@ module.exports.run = function (argv) {
["package.windows.appxmanifest", "package.windows80.appxmanifest", "package.phone.appxmanifest"].forEach(function (file) {
var fileToReplace = path.join(projectPath, file);
shell.sed('-i', /\$guid1\$/g, guid, fileToReplace);
- shell.sed('-i', /\$safeprojectname\$/g, safeAppName, fileToReplace);
- shell.sed('-i', /\$projectname\$/g, packageName, fileToReplace);
+ shell.sed('-i', /\$safeprojectname\$/g, packageName, fileToReplace);
+ shell.sed('-i', /\$projectname\$/g, safeAppName, fileToReplace);
});
// Delete bld forder and bin folder