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')