mirror of
https://github.com/Routstr/routstrd.git
synced 2026-10-05 12:28:23 +00:00
fix(cli): dynamically read version from package.json
This commit is contained in:
+2
-3
@@ -30,6 +30,7 @@ import {
|
||||
isCocodInstalled,
|
||||
resolveCocodExecutable,
|
||||
} from "./daemon/wallet/cocod-client";
|
||||
import packageJson from "../package.json" with { type: "json" };
|
||||
|
||||
type RoutstrModel = {
|
||||
id: string;
|
||||
@@ -52,8 +53,6 @@ type UsageEntry = {
|
||||
client?: string;
|
||||
};
|
||||
|
||||
const cliVersion = "0.1.1";
|
||||
|
||||
function parsePositiveIntOrExit(value: string, fieldName: string): number {
|
||||
const parsed = Number.parseInt(value, 10);
|
||||
if (!Number.isFinite(parsed) || parsed <= 0) {
|
||||
@@ -209,7 +208,7 @@ async function initDaemon(): Promise<void> {
|
||||
program
|
||||
.name("routstrd")
|
||||
.description("Routstr daemon - Manage routstr processes")
|
||||
.version(cliVersion, "--version", "output the version number");
|
||||
.version(packageJson.version, "--version", "output the version number");
|
||||
|
||||
// Onboard - initialize the daemon
|
||||
program
|
||||
|
||||
Reference in New Issue
Block a user