From d9d4d4caacf28d9eeabe23cb2eaa9fcce5ca6c90 Mon Sep 17 00:00:00 2001
From: haouarihk <haithem2001@gmail.com>
Date: Sat, 23 Mar 2024 18:51:35 +0100
Subject: [PATCH] .

---
 version-bump.mjs | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/version-bump.mjs b/version-bump.mjs
index 5880d5ec..4612a606 100644
--- a/version-bump.mjs
+++ b/version-bump.mjs
@@ -1,8 +1,9 @@
 import { readFileSync, writeFileSync } from "fs";
 import { execSync } from "node:child_process";
 import { exit } from "process";
+const packageJSON = JSON.parse(readFileSync("package.json", "utf8"));
 
-const targetVersion = process.env.npm_package_version;
+const targetVersion = packageJSON.version;
 const dryRun = !process.argv[2] || process.argv[2] !== "--go";
 
 try {
@@ -25,8 +26,8 @@ try {
   }
 
   // load manifest and check beta version
-  let manifest = JSON.parse(readFileSync("manifest.json", "utf8"));
-  let obsidian = JSON.parse(readFileSync("package.json", "utf8")).obsidian;
+  const manifest = JSON.parse(readFileSync("manifest.json", "utf8"));
+  const obsidian = packageJSON.obsidian;
   const isBeta = targetVersion.endsWith("beta");
 
   console.log(`new version : ${targetVersion}`);