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:
parent
a8c364e9b3
commit
cc5c99beb0
1 changed files with 8 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue