This commit is contained in:
Tamius Han 2024-01-28 13:08:31 +01:00
parent b8fdf0911a
commit 5ca9325e16
2 changed files with 7 additions and 7 deletions

View File

@ -5,7 +5,7 @@
# #
# Script assumes we're in basedir of the repository and that extension has been built and zipped to /dist-zip # Script assumes we're in basedir of the repository and that extension has been built and zipped to /dist-zip
# using the crx name we want (same name as zip, except different extension) # using the crx name we want (same name as zip, except different extension)
# #
# also this doesn't check for errors ever so # also this doesn't check for errors ever so
# #
@ -42,4 +42,4 @@ sig_len_hex=$(byte_swap $(printf '%08x\n' $(ls -l "$sig" | awk '{print $5}')))
echo "Wrote $crx" echo "Wrote $crx"
echo "exiting dist-zip" echo "exiting dist-zip"
cd .. cd ..

View File

@ -24,7 +24,7 @@ const buildZip = (src, dist, zipFilename) => {
const archive = archiver('zip', { zlib: { level: 9 }}); const archive = archiver('zip', { zlib: { level: 9 }});
const stream = fs.createWriteStream(path.join(dist, zipFilename)); const stream = fs.createWriteStream(path.join(dist, zipFilename));
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
archive archive
.directory(src, false) .directory(src, false)
@ -46,14 +46,14 @@ const main = () => {
browserPostfix = browser; browserPostfix = browser;
} }
const destDir = path.join(__dirname, `../dist-${browserPostfix}`); const destDir = path.join(__dirname, `../dist-${browserPostfix}`);
const zipDir = path.join(__dirname, '../dist-zip'); const zipDir = path.join(__dirname, '../dist-zip');
const {name, version} = extractExtensionData(browserPostfix); const {name, version} = extractExtensionData(browserPostfix);
// collapse spaces and dashes into single dash // collapse spaces and dashes into single dash
const baseFilename = `${name.replace(/[ -]+/g, '-')}-${version}`; const baseFilename = `${name.replace(/[ -]+/g, '-')}-${version}`;
let realZipDir; let realZipDir;
if (!!testingOrNightly) { if (!!testingOrNightly) {
realZipDir = path.join(zipDir, version); realZipDir = path.join(zipDir, version);
} else { } else {
@ -61,7 +61,7 @@ const main = () => {
} }
const zipFilename = `${baseFilename}-${browser}.zip`; const zipFilename = `${baseFilename}-${browser}.zip`;
try { try {
makeDirIfNotExists(realZipDir, {recursive: true}); makeDirIfNotExists(realZipDir, {recursive: true});
} catch (e) { } catch (e) {
@ -70,7 +70,7 @@ const main = () => {
} }
buildZip(destDir, realZipDir, zipFilename) buildZip(destDir, realZipDir, zipFilename)
.then(() => console.info('OK')) .then(() => console.info('OK'))
.catch(console.err); .catch(console.err);
}; };
main(); main();