diff --git a/version-bump.mjs b/version-bump.mjs new file mode 100644 index 0000000..4589f84 --- /dev/null +++ b/version-bump.mjs @@ -0,0 +1,19 @@ +import { readFileSync, writeFileSync } from 'fs'; + +const targetVersion = process.env.npm_package_version; + +// Read minAppVersion from manifest.json and bump version to target version +const manifest = JSON.parse(readFileSync('manifest.json', 'utf8')); +const { minAppVersion } = manifest; +manifest.version = targetVersion; +writeFileSync('manifest.json', JSON.stringify(manifest, null, 2) + '\n'); + +// Read versions.json and bump version to target version +let versions = {}; +try { + versions = JSON.parse(readFileSync('versions.json', 'utf8')); +} catch (e) { + // If versions.json doesn't exist, initialize +} +versions[targetVersion] = minAppVersion; +writeFileSync('versions.json', JSON.stringify(versions, null, 2) + '\n'); diff --git a/versions.json b/versions.json new file mode 100644 index 0000000..b062909 --- /dev/null +++ b/versions.json @@ -0,0 +1,3 @@ +{ + "0.1.3": "0.15.0" +}