From 27a8d204e7c84d0e661229d9f619387e1a8c0e1f Mon Sep 17 00:00:00 2001 From: chouchouji <1305974212@qq.com> Date: Sat, 26 Oct 2024 11:17:48 +0800 Subject: [PATCH] feat: support viewing current version --- bin/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/index.js b/bin/index.js index d449e4e..bd6a25a 100755 --- a/bin/index.js +++ b/bin/index.js @@ -1,9 +1,15 @@ #!/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))) + +program.version(packageJson.version) + program .command('release') .option('-r --remote ', 'Remote name')