forked from AdguardTeam/AdguardBrowserExtension
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-updates-files.js
More file actions
28 lines (22 loc) · 928 Bytes
/
build-updates-files.js
File metadata and controls
28 lines (22 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
* Build files for browsers updating.
* Version received automatically from package.json.
*/
// TODO remove this task for builds after v3.5.0
import fs from 'fs';
import gulp from 'gulp';
import { version } from './parse-package';
const copyFiles = () => gulp.src('./tasks/resources/**').pipe(gulp.dest('./'));
const chromeUpdate = (done) => {
let chromeUpdates = fs.readFileSync('./chrome_updates.xml').toString();
chromeUpdates = chromeUpdates.replace(/\%VERSION\%/g, version);
fs.writeFileSync('./chrome_updates.xml', chromeUpdates);
return done();
};
const firefoxJSONUpdate = (done) => {
let firefoxUpdates = fs.readFileSync('./firefox_updates.json').toString();
firefoxUpdates = firefoxUpdates.replace(/\%VERSION\%/g, version);
fs.writeFileSync('./firefox_updates.json', firefoxUpdates);
return done();
};
export default gulp.series(copyFiles, chromeUpdate, firefoxJSONUpdate);