Skip to content

Commit

Permalink
refactor(cli): ♻️ get package.json through a one liner
Browse files Browse the repository at this point in the history
  • Loading branch information
TBroz15 committed Oct 23, 2024
1 parent 2021a8f commit 0324b6c
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/cli/utils/get_version.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
import { readFileSync } from "fs";
import { fileURLToPath } from "url";
import { dirname, resolve } from "path";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

export const { version } = JSON.parse(
readFileSync(resolve(__dirname, "../../../package.json"), "utf-8")
) as { version: string };
export { version } from "../../../package.json" assert { type: "json" };

0 comments on commit 0324b6c

Please sign in to comment.