1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-29 15:11:58 +00:00

fix: load env files for cli (#3503)

This commit is contained in:
Jason Rasmussen 2023-08-01 18:07:52 -04:00 committed by GitHub
parent 310fab526d
commit 2835919931
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 10 additions and 6 deletions

View file

@ -1 +0,0 @@
node ./dist/main cli "$@"

View file

@ -54,7 +54,7 @@
}, },
"bin": { "bin": {
"immich": "bin/cli.sh", "immich": "bin/cli.sh",
"immich-admin": "bin/admin-cli.sh" "immich-admin": "start.sh admin-cli"
}, },
"devDependencies": { "devDependencies": {
"@nestjs/cli": "^9.1.8", "@nestjs/cli": "^9.1.8",

View file

@ -7,7 +7,7 @@
"license": "UNLICENSED", "license": "UNLICENSED",
"bin": { "bin": {
"immich": "./bin/cli.sh", "immich": "./bin/cli.sh",
"immich-admin": "./bin/admin-cli.sh" "immich-admin": "./start.sh admin-cli"
}, },
"scripts": { "scripts": {
"build": "nest build", "build": "nest build",

View file

@ -1,4 +1,4 @@
import { bootstrap as cli } from './cli/immich'; import { bootstrap as adminCli } from './admin-cli/main';
import { bootstrap as immich } from './immich/main'; import { bootstrap as immich } from './immich/main';
import { bootstrap as microservices } from './microservices/main'; import { bootstrap as microservices } from './microservices/main';
@ -14,8 +14,8 @@ function bootstrap() {
return immich(); return immich();
case 'microservices': case 'microservices':
return microservices(); return microservices();
case 'cli': case 'admin-cli':
return cli(); return adminCli();
default: default:
console.log(`Invalid app name: ${immichApp}. Expected one of immich|microservices|cli`); console.log(`Invalid app name: ${immichApp}. Expected one of immich|microservices|cli`);
process.exit(1); process.exit(1);

View file

@ -1,5 +1,10 @@
#!/bin/sh #!/bin/sh
if [ "$DB_URL_FILE" ]; then
export DB_URL=$(cat $DB_URL_FILE)
unset DB_URL_FILE
fi
if [ "$DB_HOSTNAME_FILE" ]; then if [ "$DB_HOSTNAME_FILE" ]; then
export DB_HOSTNAME=$(cat $DB_HOSTNAME_FILE) export DB_HOSTNAME=$(cat $DB_HOSTNAME_FILE)
unset DB_HOSTNAME_FILE unset DB_HOSTNAME_FILE