diff options
Diffstat (limited to 'apps/cli/src')
| -rw-r--r-- | apps/cli/src/index.ts | 6 | ||||
| -rw-r--r-- | apps/cli/src/vite-env.d.ts | 9 |
2 files changed, 14 insertions, 1 deletions
diff --git a/apps/cli/src/index.ts b/apps/cli/src/index.ts index 12cd7a13..a4f6f7b4 100644 --- a/apps/cli/src/index.ts +++ b/apps/cli/src/index.ts @@ -22,7 +22,11 @@ const program = new Command() .makeOptionMandatory(true) .env("HOARDER_SERVER_ADDR"), ) - .version(process.env.npm_package_version ?? "0.0.0"); + .version( + import.meta.env && "CLI_VERSION" in import.meta.env + ? import.meta.env.CLI_VERSION + : "0.0.0", + ); program.addCommand(bookmarkCmd); program.addCommand(listsCmd); diff --git a/apps/cli/src/vite-env.d.ts b/apps/cli/src/vite-env.d.ts new file mode 100644 index 00000000..604ce503 --- /dev/null +++ b/apps/cli/src/vite-env.d.ts @@ -0,0 +1,9 @@ +/// <reference types="vite/client" /> + +interface ImportMetaEnv { + readonly CLI_VERSION: string; +} + +interface ImportMeta { + readonly env: ImportMetaEnv; +} |
