From 270562db14c1bbf17be04b265c76324262104e6a Mon Sep 17 00:00:00 2001 From: chouchouji <1305974212@qq.com> Date: Tue, 10 Dec 2024 14:43:10 +0800 Subject: [PATCH] refactor: optimize version reading code --- 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)