diff --git a/package.json b/package.json index 203d7c0..7f1f5f6 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "dev": "node esbuild.config.mjs", "build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production", - "version": "node version-bump.mjs" + "version": "node version-bump.mjs && git add manifest.json versions.json" }, "keywords": [], "author": "", diff --git a/version-bump.mjs b/version-bump.mjs index be11fe4..a642a97 100644 --- a/version-bump.mjs +++ b/version-bump.mjs @@ -1,25 +1,14 @@ -import { readFile as readFile0, writeFile as writeFile0 } from "fs"; -import { exec as exec0 } from "child_process"; -import { promisify } from "util"; - -const exec = promisify(exec0), - readFile = promisify(readFile0), - writeFile = promisify(writeFile0); +import { readFileSync, writeFileSync } from "fs"; const targetVersion = process.env.npm_package_version; -(async () => { - // read minAppVersion from manifest.json and bump version to target version - let menifest = JSON.parse((await readFile("manifest.json")).toString()); - const { minAppVersion } = menifest; - menifest.version = targetVersion; - await writeFile("manifest.json", JSON.stringify(menifest, null, "\t")); +// read minAppVersion from manifest.json and bump version to target version +let menifest = JSON.parse(readFileSync("manifest.json").toString()); +const { minAppVersion } = menifest; +menifest.version = targetVersion; +writeFileSync("manifest.json", JSON.stringify(menifest, null, "\t")); - // update versions.json with target version and minAppVersion from manifest.json - let versions = JSON.parse((await readFile("versions.json")).toString()); - versions[targetVersion] = minAppVersion; - await writeFile("versions.json", JSON.stringify(versions, null, "\t")); - - // save changes in git - await exec("git add manifest.json versions.json"); -})().catch(() => process.exit(1)); +// update versions.json with target version and minAppVersion from manifest.json +let versions = JSON.parse(readFileSync("versions.json").toString()); +versions[targetVersion] = minAppVersion; +writeFileSync("versions.json", JSON.stringify(versions, null, "\t")); diff --git a/versions.json b/versions.json index 9f1da4b..4bca15f 100644 --- a/versions.json +++ b/versions.json @@ -1,4 +1,4 @@ { "1.0.0": "0.9.7", - "1.0.1": "0.9.12" + "1.0.1": "0.12.0" }