0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-31 22:51:25 -05:00

refactor(cli): support dotenv

This commit is contained in:
Gao Sun 2022-10-08 18:18:49 +08:00
parent a8c364e9b3
commit cc5c99beb0
No known key found for this signature in database
GPG key ID: 13EBE123E4773688

View file

@ -5,9 +5,15 @@ import { hideBin } from 'yargs/helpers';
import database from './commands/database';
import install from './commands/install';
dotenv.config();
void yargs(hideBin(process.argv))
.option('env', {
alias: ['e', 'env-file'],
describe: 'The path to your `.env` file',
type: 'string',
})
.middleware(({ env }) => {
dotenv.config({ path: env });
})
.command(install)
.command(database)
.demandCommand(1)