mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Copy completed translations over when building
This commit is contained in:
parent
a0dd3d9edc
commit
9c20ab3984
1 changed files with 16 additions and 8 deletions
|
@ -37,11 +37,15 @@ var SHARED_FILES = [
|
|||
];
|
||||
|
||||
var concatJS = function(outDir, init, outFile) {
|
||||
var files;
|
||||
files = FILES.concat(`init-${init}.js`);
|
||||
var files = FILES.concat(`init-${init}.js`);
|
||||
execSync(`cat ${files.join(' ')} > ${outDir}/${outFile}`);
|
||||
};
|
||||
|
||||
var copyTranslations = function(outDir) {
|
||||
execSync('git submodule update --init -- translation')
|
||||
execSync(`cp -rf translation/* ${outDir}/_locales/`);
|
||||
};
|
||||
|
||||
var tasks = new Map();
|
||||
|
||||
var task = function(key, msg, func) {
|
||||
|
@ -68,16 +72,20 @@ task('test', 'snowflake unit tests', function() {
|
|||
});
|
||||
|
||||
task('build', 'build the snowflake proxy', function() {
|
||||
execSync('rm -rf build');
|
||||
execSync('cp -r ' + STATIC + '/ build/');
|
||||
concatJS('build', 'badge', 'embed.js');
|
||||
const outDir = 'build';
|
||||
execSync(`rm -rf ${outDir}`);
|
||||
execSync(`cp -r ${STATIC}/ ${outDir}/`);
|
||||
copyTranslations(outDir);
|
||||
concatJS(outDir, 'badge', 'embed.js');
|
||||
console.log('Snowflake prepared.');
|
||||
});
|
||||
|
||||
task('webext', 'build the webextension', function() {
|
||||
execSync('mkdir -p webext');
|
||||
execSync(`cp -r ${STATIC}/{${SHARED_FILES.join(',')}} webext/`, { shell: '/bin/bash' });
|
||||
concatJS('webext', 'webext', 'snowflake.js');
|
||||
const outDir = 'webext';
|
||||
execSync(`git clean -f -x -d ${outDir}/`);
|
||||
execSync(`cp -r ${STATIC}/{${SHARED_FILES.join(',')}} ${outDir}/`, { shell: '/bin/bash' });
|
||||
copyTranslations(outDir);
|
||||
concatJS(outDir, 'webext', 'snowflake.js');
|
||||
console.log('Webextension prepared.');
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue