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
175
175
Login as HMD successfully!
176
176
```
177
177
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.
179
179
180
180
_ See code: [ src/commands/login.ts] ( https://github.com/hackmdio/codimd-cli/blob/v1.0.3/src/commands/login.ts ) _
181
181
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import {Command, flags} from '@oclif/command'
2
2
import * as inquirer from 'inquirer'
3
3
4
4
import { APIClient } from '../api'
5
+ import config from '../config'
5
6
6
7
export default class Login extends Command {
7
8
static description = 'Login HackMD instance from CLI'
@@ -25,8 +26,8 @@ Login as HMD successfully!
25
26
async run ( ) {
26
27
const { flags} = this . parse ( Login )
27
28
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 || ''
30
31
31
32
if ( ! id ) {
32
33
if ( flags . ldap ) {
Original file line number Diff line number Diff line change @@ -33,7 +33,9 @@ const envConfig = {
33
33
? true
34
34
: ( process . env . CMD_CLI_COOKIE_PATH || process . env . CMD_CLI_SERVER_URL )
35
35
? 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
37
39
}
38
40
39
41
// 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