mirror of
https://github.com/insin/control-panel-for-twitter.git
synced 2025-06-18 22:55:32 -04:00

- All page script settings are now stored in a single settings object - All other top-level config is for extension-internal settings - Renamed old settings which were marked with comments in types.d.ts Background script - Open welcome (new installs) or updated (v4 → v5) page post-install - Migrate v4 user settings to new v5 format on update Page script: - Removed userscript pragma - Renamed page script config variable to 'settings' Scripts: - Moved utility and script API functions to lib.js - Updated copy script to copy all *.mv*.* files in the root dir - Added a clean script and command to remove files which correspond to a *.mv*.* file
29 lines
977 B
JavaScript
29 lines
977 B
JavaScript
const {execSync} = require('child_process')
|
|
const path = require('path')
|
|
const fs = require('fs')
|
|
|
|
const {clean, copy} = require('./lib')
|
|
|
|
/** @type {import('./types').ManifestVersion[]} */
|
|
let manifestVersions = [2, 3]
|
|
if (process.argv[2]) {
|
|
let manifestVersion = Number(process.argv[2])
|
|
if (manifestVersion == 2 || manifestVersion == 3) {
|
|
manifestVersions = [manifestVersion]
|
|
}
|
|
}
|
|
|
|
for (let manifestVersion of manifestVersions) {
|
|
console.log(`\nBuilding MV${manifestVersion} version`)
|
|
let manifestFile = `manifest.mv${manifestVersion}.json`
|
|
let manifestData = require(`../${manifestFile}`)
|
|
copy(manifestVersion)
|
|
execSync('web-ext build', {stdio: 'inherit'})
|
|
let renameTo = `./web-ext-artifacts/control_panel_for_twitter-${manifestData['version']}.mv${manifestVersion}.zip`
|
|
fs.renameSync(
|
|
`./web-ext-artifacts/control_panel_for_twitter-${manifestData['version']}.zip`,
|
|
renameTo,
|
|
)
|
|
console.log('Moved to:', path.resolve(renameTo))
|
|
clean()
|
|
} |