From 9998df39ad6054f7336d94c045e2ef1bc7e766c2 Mon Sep 17 00:00:00 2001 From: Manuel Astudillo Date: Sat, 6 Jul 2024 12:53:42 +0200 Subject: [PATCH] fix: fix package.json loading --- lib/cmd.ts | 5 +---- lib/version-checker.ts | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/cmd.ts b/lib/cmd.ts index 0c7e1d5..eaee94b 100644 --- a/lib/cmd.ts +++ b/lib/cmd.ts @@ -9,10 +9,7 @@ import { versionChecker } from "./version-checker"; export const run = () => { // Read the content of package.json - const packageJsonContent = readFileSync("./package.json", "utf8"); - - // Parse the JSON data - const { name, version } = JSON.parse(packageJsonContent); + const { name, version } = require(__dirname + "/../package.json") as { name: string, version: string } console.info( blueBright( diff --git a/lib/version-checker.ts b/lib/version-checker.ts index 2640a23..35a1b9c 100644 --- a/lib/version-checker.ts +++ b/lib/version-checker.ts @@ -29,6 +29,5 @@ export const versionChecker = async (name: string, version: string) => { ), err ); - process.exit(1); } };