File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ EXAMPLE
175175 Login as HMD successfully!
176176```
177177
178- Alternatively, you may supply an email and password via the ` CMD_EMAIL ` and ` CMD_PASSWORD ` environment variables, respectively.
178+ Alternatively, you may supply an email and password via the ` CMD_CLI_ID ` and ` CMD_CLI_PASSWORD ` environment variables, respectively.
179179
180180_ See code: [ src/commands/login.ts] ( https://github.com/hackmdio/codimd-cli/blob/v1.0.3/src/commands/login.ts ) _
181181
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import {Command, flags} from '@oclif/command'
22import * as inquirer from 'inquirer'
33
44import { APIClient } from '../api'
5+ import config from '../config'
56
67export default class Login extends Command {
78 static description = 'Login HackMD instance from CLI'
@@ -25,8 +26,8 @@ Login as HMD successfully!
2526 async run ( ) {
2627 const { flags} = this . parse ( Login )
2728
28- let id = flags . id || process . env . CMD_CLI_ID
29- let password = process . env . CMD_CLI_PASSWORD || ''
29+ let id = flags . id || config . loginID
30+ let password = config . loginPassword || ''
3031
3132 if ( ! id ) {
3233 if ( flags . ldap ) {
Original file line number Diff line number Diff line change @@ -33,7 +33,9 @@ const envConfig = {
3333 ? true
3434 : ( process . env . CMD_CLI_COOKIE_PATH || process . env . CMD_CLI_SERVER_URL )
3535 ? false
36- : toBooleanConfig ( process . env . HMD_CLI_ENTERPRISE )
36+ : toBooleanConfig ( process . env . HMD_CLI_ENTERPRISE ) ,
37+ loginID : process . env . HMD_CLI_ID || process . env . CMD_CLI_ID ,
38+ loginPassword : process . env . HMD_CLI_PASSWORD || process . env . CMD_CLI_PASSWORD
3739}
3840
3941// look for a readable config file; we can merge it with the env.
You can’t perform that action at this time.
0 commit comments