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
11 changed files with 10 additions and 6 deletions

View File

@@ -0,0 +1,23 @@
import { UserService } from '@app/domain';
import { Command, CommandRunner } from 'nest-commander';
import { CLI_USER } from '../constants';
@Command({
name: 'list-users',
description: 'List Immich users',
})
export class ListUsersCommand extends CommandRunner {
constructor(private userService: UserService) {
super();
}
async run(): Promise<void> {
try {
const users = await this.userService.getAllUsers(CLI_USER, true);
console.dir(users);
} catch (error) {
console.error(error);
console.error('Unable to load users');
}
}
}