Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
49
gaia/build/update-webapps-json.js
Executable file
49
gaia/build/update-webapps-json.js
Executable file
|
|
@ -0,0 +1,49 @@
|
|||
'use strict';
|
||||
|
||||
/**
|
||||
* Updates webapps.json's manifest.webapp hash and package.json hash fields for
|
||||
* checking FOTA update
|
||||
*/
|
||||
|
||||
var utils = require('./utils');
|
||||
|
||||
function execute(options) {
|
||||
var profileDir = options.PROFILE_DIR;
|
||||
var stageDir = options.STAGE_DIR;
|
||||
var webappsJSONFile = utils.getFile(options.PROFILE_DIR, 'webapps',
|
||||
'webapps.json');
|
||||
|
||||
if (!utils.fileExists(webappsJSONFile.path)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var webappsJSON = utils.getJSON(webappsJSONFile);
|
||||
|
||||
for (let app in webappsJSON) {
|
||||
var manifestFile = utils.joinPath(profileDir, 'webapps', app,
|
||||
'manifest.webapp');
|
||||
var updateFile = utils.joinPath(profileDir, 'webapps', app,
|
||||
'update.webapp');
|
||||
var mainManifestFile;
|
||||
var appName = app.substring(0, app.indexOf('.'));
|
||||
var packageJSON = utils.joinPath(stageDir, appName, 'package.json');
|
||||
|
||||
if (utils.fileExists(manifestFile)) {
|
||||
mainManifestFile = manifestFile;
|
||||
} else if (utils.fileExists(updateFile)) {
|
||||
mainManifestFile = updateFile;
|
||||
}
|
||||
|
||||
if (mainManifestFile) {
|
||||
webappsJSON[app].manifestHash = utils.getMD5hash(mainManifestFile);
|
||||
}
|
||||
|
||||
if (utils.fileExists(packageJSON)) {
|
||||
webappsJSON[app].packageHash = utils.getMD5hash(packageJSON);
|
||||
}
|
||||
}
|
||||
|
||||
utils.writeContent(webappsJSONFile, JSON.stringify(webappsJSON, null, 2));
|
||||
}
|
||||
|
||||
exports.execute = execute;
|
||||
Loading…
Reference in a new issue