From cae7ccafef99815dd9d3b8c6cf42360781c1f162 Mon Sep 17 00:00:00 2001 From: Antonio Date: Fri, 1 Mar 2024 20:08:43 +0200 Subject: [PATCH] chore: update version bump script. Clean up versions.json --- package.json | 2 +- version-bump.mjs | 21 ++++++++++----------- versions.json | 6 +----- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 8bb60fa..2738848 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 && git add manifest.json versions.json" + "version": "node version-bump.mjs" }, "keywords": [ "obsidian", diff --git a/version-bump.mjs b/version-bump.mjs index d409fa0..5197cf1 100644 --- a/version-bump.mjs +++ b/version-bump.mjs @@ -1,14 +1,13 @@ -import { readFileSync, writeFileSync } from "fs"; +#!/usr/bin/env node -const targetVersion = process.env.npm_package_version; +import { readFileSync, writeFileSync } from 'fs'; -// read minAppVersion from manifest.json and bump version to target version -let manifest = JSON.parse(readFileSync("manifest.json", "utf8")); -const { minAppVersion } = manifest; -manifest.version = targetVersion; -writeFileSync("manifest.json", JSON.stringify(manifest, null, "\t")); +let targetVersion = process.argv[2]; + +let packageJson = JSON.parse(readFileSync('package.json', 'utf8')); +packageJson.version = targetVersion; +writeFileSync('package.json', JSON.stringify(packageJson, null, '\t')); -// update versions.json with target version and minAppVersion from manifest.json -let versions = JSON.parse(readFileSync("versions.json", "utf8")); -versions[targetVersion] = minAppVersion; -writeFileSync("versions.json", JSON.stringify(versions, null, "\t")); +let manifest = JSON.parse(readFileSync('manifest.json', 'utf8')); +manifest.version = targetVersion; +writeFileSync('manifest.json', JSON.stringify(manifest, null, '\t')); diff --git a/versions.json b/versions.json index 4c14266..26382a1 100644 --- a/versions.json +++ b/versions.json @@ -1,7 +1,3 @@ { - "1.0.0": "0.15.0", - "1.0.1": "0.15.0", - "1.0.2": "0.15.0", - "1.1.0": "0.15.0", - "1.1.1": "0.15.0" + "1.0.0": "0.15.0" }