Skip to content

Commit c019bd6

Browse files
authored
Merge pull request #27 from zero8dotdev/fix/v0.3.1-version-command
fix: add --version command handler (v0.3.1)
2 parents 38335f2 + 5f7ac47 commit c019bd6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ async function main() {
149149
return;
150150
}
151151

152+
// Handle --version early (doesn't need DB)
153+
if (command === "--version" || command === "-v") {
154+
const pkg = require("../package.json");
155+
console.log(`smriti ${pkg.version}`);
156+
return;
157+
}
158+
152159
// Initialize DB
153160
const db = initSmriti();
154161

0 commit comments

Comments
 (0)