From 4c3c25d19537246ec6c934f6e9086ea6fb833414 Mon Sep 17 00:00:00 2001 From: chouchouji <70570907+chouchouji@users.noreply.github.com> Date: Tue, 10 Dec 2024 17:25:26 +0800 Subject: [PATCH] refactor: optimize version reading code (#21) --- bin/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/index.js b/bin/index.js index d6569ff..7ba0870 100755 --- a/bin/index.js +++ b/bin/index.js @@ -1,12 +1,11 @@ #!/usr/bin/env node import { release, publish, changelog, commitLint } from '../dist/index.js' import { Command } from 'commander' -import { fileURLToPath } from 'url' import fse from 'fs-extra' const program = new Command() -const packageJson = fse.readJSONSync(fileURLToPath(new URL('../package.json', import.meta.url))) +const packageJson = fse.readJSONSync(new URL('../package.json', import.meta.url)) program.version(packageJson.version)