Skip to content

Commit

Permalink
fix: load env files for cli (immich-app#3503)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrasm91 authored Aug 1, 2023
1 parent 310fab5 commit 2835919
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 6 deletions.
1 change: 0 additions & 1 deletion server/bin/admin-cli.sh

This file was deleted.

2 changes: 1 addition & 1 deletion server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "UNLICENSED",
"bin": {
"immich": "./bin/cli.sh",
"immich-admin": "./bin/admin-cli.sh"
"immich-admin": "./start.sh admin-cli"
},
"scripts": {
"build": "nest build",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions server/src/main.ts
Original file line number Diff line number Diff line change
@@ -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 microservices } from './microservices/main';

Expand All @@ -14,8 +14,8 @@ function bootstrap() {
return immich();
case 'microservices':
return microservices();
case 'cli':
return cli();
case 'admin-cli':
return adminCli();
default:
console.log(`Invalid app name: ${immichApp}. Expected one of immich|microservices|cli`);
process.exit(1);
Expand Down
5 changes: 5 additions & 0 deletions server/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/sh

if [ "$DB_URL_FILE" ]; then
export DB_URL=$(cat $DB_URL_FILE)
unset DB_URL_FILE
fi

if [ "$DB_HOSTNAME_FILE" ]; then
export DB_HOSTNAME=$(cat $DB_HOSTNAME_FILE)
unset DB_HOSTNAME_FILE
Expand Down

0 comments on commit 2835919

Please sign in to comment.