mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-23 10:30:04 +01:00
4ced29e3a2
The version field is now stored in the main `package.json` file rather than in the base manifest. It is built into the final manifest during the build script. This makes it easier to communicate what the current version should be to our `auto-changelog` script. It's also generally a more conventional place to keep track of the version, even considering that we're not publishing to npm.
46 lines
1.2 KiB
JavaScript
46 lines
1.2 KiB
JavaScript
const { promises: fs } = require('fs');
|
|
const gulp = require('gulp');
|
|
const gulpZip = require('gulp-zip');
|
|
const del = require('del');
|
|
const pify = require('pify');
|
|
const pump = pify(require('pump'));
|
|
const { version } = require('../../package.json');
|
|
const { createTask, composeParallel } = require('./task');
|
|
|
|
module.exports = createEtcTasks;
|
|
|
|
function createEtcTasks({ browserPlatforms, livereload }) {
|
|
const clean = createTask('clean', async function clean() {
|
|
await del(['./dist/*']);
|
|
await Promise.all(
|
|
browserPlatforms.map(async (platform) => {
|
|
await fs.mkdir(`./dist/${platform}`, { recursive: true });
|
|
}),
|
|
);
|
|
});
|
|
|
|
const reload = createTask('reload', function devReload() {
|
|
livereload.listen({ port: 35729 });
|
|
});
|
|
|
|
// zip tasks for distribution
|
|
const zip = createTask(
|
|
'zip',
|
|
composeParallel(
|
|
...browserPlatforms.map((platform) => createZipTask(platform)),
|
|
),
|
|
);
|
|
|
|
return { clean, reload, zip };
|
|
}
|
|
|
|
function createZipTask(target) {
|
|
return async () => {
|
|
await pump(
|
|
gulp.src(`dist/${target}/**`),
|
|
gulpZip(`metamask-${target}-${version}.zip`),
|
|
gulp.dest('builds'),
|
|
);
|
|
};
|
|
}
|