[
https://issues.apache.org/jira/browse/CB-12804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16030550#comment-16030550
]
ASF GitHub Bot commented on CB-12804:
-------------------------------------
Github user macdonst commented on a diff in the pull request:
https://github.com/apache/cordova-browser/pull/30#discussion_r119261228
--- Diff: bin/template/cordova/Api.js ---
@@ -96,6 +96,42 @@ Api.createPlatform = function (dest, config, options,
events) {
events.emit('error','createPlatform is not callable from the
browser project API.');
throw(e);
}
+
+ // Create manifest.json
+ var manifestJson;
+ var manifestJsonPath = path.join(dest,'manifest.json');
+
+ // Check if path exists and require manifestJsonPath.
+ if(fs.existsSync(manifestJsonPath)) {
+ try {
+ manifestJson = require(manifestJsonPath);
+ }
+ catch (e) {
+ console.log("error : " + e);
+ events.emit('error', 'unable to require manifest.json path.');
+ }
+ } else if (manifestJson === undefined) {
+ manifestJson = {};
+ if(config){
+ if(config.name()) {
+ manifestJson.name = config.name();
+ }
+ if(config.shortName()) {
+ manifestJson.short_name = config.shortName();
+ }
+ if(config.packageName()) {
+ manifestJson.version = config.packageName();
+ }
+ if(config.description()) {
+ manifestJson.description = config.description();
+ }
+ if(config.author()) {
+ manifestJson.author = config.author();
+ }
+ }
--- End diff --
Also, it may make sense to pull `manifest.theme_color` from `<preference
name="StatusBarBackgroundColor" value="#000000" />`
> Cordova-browser PWA needs a manifest file
> -----------------------------------------
>
> Key: CB-12804
> URL: https://issues.apache.org/jira/browse/CB-12804
> Project: Apache Cordova
> Issue Type: Improvement
> Components: cordova-browser
> Reporter: Audrey So
> Assignee: Audrey So
> Fix For: cordova7
>
>
> Cordova-browser PWA needs a manifest file.
> This manifest.json file should get created during cordova platform add
> browser and use values from config.xml to build.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]