Skip to content

Commit 4efc038

Browse files
authored
Fix logging --version flag (changesets#1419)
1 parent b593756 commit 4efc038

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.changeset/hungry-trains-sneeze.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@changesets/cli": patch
3+
---
4+
5+
Fix logging `--version` flag

packages/cli/src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ if (parsed.help && args.length === 1) {
6464
process.exit(0);
6565
}
6666

67+
// Version should only be shown if it's the only argument passed
68+
if (parsed.version && args.length === 1) {
69+
// eslint-disable-next-line import/no-extraneous-dependencies
70+
console.log(require("@changesets/cli/package.json").version);
71+
process.exit(0);
72+
}
73+
6774
const cwd = process.cwd();
6875

6976
run(parsed._, parsed, cwd).catch((err) => {

0 commit comments

Comments
 (0)