From af1113bf9ea82c926bc06e9c819bde09dbda6480 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 21 Nov 2023 13:12:40 -0600 Subject: [PATCH] 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 --- cli/package-lock.json | 2 +- cli/package.json | 2 +- cli/src/index.ts | 3 ++- server/bin/cli.sh | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cli/package-lock.json b/cli/package-lock.json index 45e35a7666..372160121d 100644 --- a/cli/package-lock.json +++ b/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", diff --git a/cli/package.json b/cli/package.json index 2476c4a8e1..b42da01018 100644 --- a/cli/package.json +++ b/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": { diff --git a/cli/src/index.ts b/cli/src/index.ts index f775137628..39c17cafdb 100644 --- a/cli/src/index.ts +++ b/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') diff --git a/server/bin/cli.sh b/server/bin/cli.sh index da8ea52f72..3c6b1512e3 100755 --- a/server/bin/cli.sh +++ b/server/bin/cli.sh @@ -1,2 +1,2 @@ #!/usr/bin/env bash -node ./node_modules/@immich/cli/dist/index "$@" +npx immich "$@"