This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11693 from yurenju/build-module
bug 905096 - Build script modularization r=@timdream
- Loading branch information
Showing
10 changed files
with
1,000 additions
and
809 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,35 @@ | ||
var utils = require('./utils'); | ||
var config = require('./config').config; | ||
|
||
function debug(str) { | ||
//dump(' -*- l10n-clean.js: ' + str + '\n'); | ||
} | ||
|
||
debug('Begin'); | ||
function execute() { | ||
debug('Begin'); | ||
|
||
Gaia.webapps.forEach(function(webapp) { | ||
// if BUILD_APP_NAME isn't `*`, we only accept one webapp | ||
if (BUILD_APP_NAME != '*' && webapp.sourceDirectoryName != BUILD_APP_NAME) | ||
return; | ||
utils.Gaia.webapps.forEach(function(webapp) { | ||
// if BUILD_APP_NAME isn't `*`, we only accept one webapp | ||
if (config.BUILD_APP_NAME != '*' && | ||
webapp.sourceDirectoryName != config.BUILD_APP_NAME) { | ||
return; | ||
} | ||
|
||
debug(webapp.sourceDirectoryName); | ||
debug(webapp.sourceDirectoryName); | ||
|
||
let re = new RegExp('\\.html\\.' + GAIA_DEFAULT_LOCALE + '$'); | ||
let files = ls(webapp.buildDirectoryFile, true); | ||
files.forEach(function(file) { | ||
if ( | ||
re.test(file.leafName) || | ||
file.leafName.indexOf(Gaia.aggregatePrefix) === 0 | ||
) { | ||
file.remove(false); | ||
} | ||
let re = new RegExp('\\.html\\.' + config.GAIA_DEFAULT_LOCALE + '$'); | ||
let files = utils.ls(webapp.buildDirectoryFile, true); | ||
files.forEach(function(file) { | ||
if ( | ||
re.test(file.leafName) || | ||
file.leafName.indexOf(utils.Gaia.aggregatePrefix) === 0 | ||
) { | ||
file.remove(false); | ||
} | ||
}); | ||
}); | ||
}); | ||
|
||
debug('End'); | ||
debug('End'); | ||
} | ||
|
||
exports.execute = execute; |
Oops, something went wrong.