mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
release manifest v2 for firefox
This commit is contained in:
parent
e31f5de690
commit
755ab1e3db
2 changed files with 34 additions and 1 deletions
20
Makefile
20
Makefile
|
|
@ -31,7 +31,13 @@ upload-for-analytics:
|
|||
yarn sentry-cli releases finalize "$(FULL_VERSION)"
|
||||
|
||||
compress:
|
||||
cd dist && zip -r Gitako-$(FULL_VERSION).zip * -x *.map -x *.DS_Store
|
||||
cd dist && zip -r Gitako-$(FULL_VERSION).zip * -x *.map -x *.DS_Store -x*.zip
|
||||
|
||||
patch-firefox-manifest:
|
||||
node scripts/patch-manifest-for-firefox.js
|
||||
|
||||
compress-firefox:
|
||||
cd dist && zip -r Gitako-$(FULL_VERSION)-firefox.zip * -x *.map -x *.DS_Store -x*.zip
|
||||
|
||||
compress-source:
|
||||
git archive -o dist/Gitako-$(FULL_VERSION)-source.zip HEAD
|
||||
|
|
@ -48,5 +54,17 @@ release:
|
|||
$(MAKE) test
|
||||
$(MAKE) upload-for-analytics
|
||||
$(MAKE) compress
|
||||
$(MAKE) patch-firefox-manifest
|
||||
$(MAKE) compress-firefox
|
||||
$(MAKE) compress-source
|
||||
$(MAKE) copy-build-safari
|
||||
|
||||
release-dry-run:
|
||||
$(MAKE) clean
|
||||
$(MAKE) build
|
||||
$(MAKE) test
|
||||
$(MAKE) compress
|
||||
$(MAKE) patch-firefox-manifest
|
||||
$(MAKE) compress-firefox
|
||||
$(MAKE) compress-source
|
||||
$(MAKE) copy-build-safari
|
||||
|
|
|
|||
15
scripts/patch-manifest-for-firefox.js
Normal file
15
scripts/patch-manifest-for-firefox.js
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
|
||||
const manifestPath = path.join(__dirname, '..', 'dist', 'manifest.json')
|
||||
const manifest = require(manifestPath)
|
||||
manifest.manifest_version = 2
|
||||
const serviceWorker = manifest.background?.['service_worker']
|
||||
if (serviceWorker) {
|
||||
console.log('Patching background')
|
||||
manifest.background.scripts = [serviceWorker]
|
||||
Reflect.deleteProperty(manifest.background, 'service_worker')
|
||||
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2))
|
||||
} else {
|
||||
console.log('Service worker field not found, skipped patching')
|
||||
}
|
||||
Loading…
Reference in a new issue