Skip to content

Commit 44bba3b

Browse files
committed
fix: Addign version of the package
1 parent 93a27ae commit 44bba3b

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

.releaserc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"@semantic-release/release-notes-generator",
55
"@semantic-release/changelog",
66
["@semantic-release/git", {
7-
"assets": ["CHANGELOG.md"],
7+
"assets": ["package.json", "package-lock.json", "CHANGELOG.md"],
88
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
99
}],
1010
"@semantic-release/npm",

index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
#!/usr/bin/env node
22
import { Command } from 'commander';
33
import * as fs from 'fs';
4+
import * as path from 'path';
45

56
import printTableFromInp from './src/service';
67

8+
// Read package.json to get version
9+
const packageJson = JSON.parse(
10+
fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8')
11+
);
12+
713
export function runCLI(argv: string[] = process.argv) {
814
const program = new Command();
915

1016
program
17+
.version(packageJson.version, '-v, --version', 'output the current version')
1118
.option('-i, --input <value>', 'input string')
1219
.option('-s, --stdin', 'read input from stdin')
1320
.option('-t, --tableOptions <value>', 'table options in JSON format')

0 commit comments

Comments
 (0)