浏览代码

chore(cli): add version option (#5237)

* chore(cli): add version option

* chore: update build path

* fix: defer to package details for path to entrypoint

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
Alex 1 年之前
父节点
当前提交
af1113bf9e
共有 4 个文件被更改,包括 5 次插入4 次删除
  1. 1 1
      cli/package-lock.json
  2. 1 1
      cli/package.json
  3. 2 1
      cli/src/index.ts
  4. 1 1
      server/bin/cli.sh

+ 1 - 1
cli/package-lock.json

@@ -18,7 +18,7 @@
         "yaml": "^2.3.1"
       },
       "bin": {
-        "immich": "dist/index.js"
+        "immich": "dist/src/index.js"
       },
       "devDependencies": {
         "@types/byte-size": "^8.1.0",

+ 1 - 1
cli/package.json

@@ -4,7 +4,7 @@
   "description": "Command Line Interface (CLI) for Immich",
   "main": "dist/index.js",
   "bin": {
-    "immich": "./dist/index.js"
+    "immich": "./dist/src/index.js"
   },
   "license": "MIT",
   "dependencies": {

+ 2 - 1
cli/src/index.ts

@@ -5,8 +5,9 @@ import Upload from './commands/upload';
 import ServerInfo from './commands/server-info';
 import LoginKey from './commands/login/key';
 import Logout from './commands/logout';
+import { version } from '../package.json';
 
-program.name('immich').description('Immich command line interface');
+program.name('immich').description('Immich command line interface').version(version);
 
 program
   .command('upload')

+ 1 - 1
server/bin/cli.sh

@@ -1,2 +1,2 @@
 #!/usr/bin/env bash
-node ./node_modules/@immich/cli/dist/index "$@"
+npx immich "$@"