Skip to content

Commit 42f7e00

Browse files
committed
Add enterprise configuration
1 parent c1875d3 commit 42f7e00

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/config.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import * as fs from 'fs-extra'
2-
import * as path from 'path'
3-
42
import defaults from 'lodash/defaults'
53
import {homedir} from 'os'
4+
import * as path from 'path'
65

76
let configDir
87
if (process.env.HMD_CLI_CONFIG_DIR) {
@@ -16,12 +15,14 @@ const defaultCookiePath = path.join(homedir(), '.codimd', 'cookies.json')
1615

1716
const defaultConfig = {
1817
cookiePath: defaultCookiePath,
19-
serverUrl: ''
18+
serverUrl: 'https://hackmd.io',
19+
enterprise: true
2020
}
2121

2222
const envConfig = {
23-
cookiePath: process.env.CMD_CLI_COOKIE_PATH,
24-
serverUrl: process.env.CMD_CLI_SERVER_URL
23+
cookiePath: process.env.HMD_CLI_COOKIE_PATH || process.env.CMD_CLI_COOKIE_PATH,
24+
serverUrl: process.env.HMD_CLI_SERVER_URL || process.env.CMD_CLI_SERVER_URL,
25+
enterprise: (process.env.HMD_CLI_COOKIE_PATH || process.env.HMD_CLI_SERVER_URL)
2526
}
2627

2728
// look for a readable config file; we can merge it with the env.
@@ -120,6 +121,4 @@ ${err}
120121
}
121122
}
122123

123-
124-
125124
export default config

0 commit comments

Comments
 (0)