Skip to content
Snippets Groups Projects
Commit 6e6e52fd authored by Cecylia Bocovich's avatar Cecylia Bocovich
Browse files

Added packaging script for webextension

Added a new script to package the webextension. This will automatically
build and zip the source code and the webextension for upload. It take a
version as an argument and then checks the version in the manifest, and
locally commits a version bump.
parent b4f4b29a
No related branches found
No related tags found
No related merge requests found
...@@ -112,6 +112,30 @@ task('node', 'build the node binary', function() { ...@@ -112,6 +112,30 @@ task('node', 'build the node binary', function() {
console.log('Node prepared.'); console.log('Node prepared.');
}); });
task('pack-webext', 'pack the webextension for deployment', function() {
try {
execSync(`rm -f source.zip`);
execSync(`rm -f webext/webext.zip`);
} catch (error) {
console.log('Error removing zip files');
}
execSync(`git submodule update --remote`);
var version = process.argv[3];
console.log(version);
var manifest = require('./webext/manifest.json')
manifest.version = version;
writeFileSync('./webext/manifest.json', JSON.stringify(manifest, null, 2), 'utf8');
execSync(`git commit -am "bump version to ${version}"`);
try {
execSync(`git tag webext-${version}`);
} catch (error) {
console.log('Error creating git tag');
}
execSync(`git archive -o source.zip HEAD .`);
execSync(`npm run webext`);
execSync(`cd webext && zip -Xr webext.zip ./*`);
});
task('clean', 'remove all built files', function() { task('clean', 'remove all built files', function() {
execSync('rm -rf build test spec/support'); execSync('rm -rf build test spec/support');
}); });
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
"test": "node make.js test", "test": "node make.js test",
"build": "node make.js build", "build": "node make.js build",
"webext": "node make.js webext", "webext": "node make.js webext",
"pack-webext": "node make.js pack-webext",
"clean": "node make.js clean", "clean": "node make.js clean",
"prepublish": "node make.js node", "prepublish": "node make.js node",
"start": "node build/snowflake.js", "start": "node build/snowflake.js",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment