Skip to content

Commit 760598e

Browse files
authoredNov 27, 2023
fix: correctly override local agent (#188)
1 parent 4890f32 commit 760598e

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed
 

‎src/config.ts

+9-12
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,16 @@ let config: Config | undefined
2929

3030
export async function getConfig(): Promise<Config> {
3131
if (!config) {
32+
config = Object.assign(
33+
{},
34+
defaultConfig,
35+
fs.existsSync(rcPath)
36+
? ini.parse(fs.readFileSync(rcPath, 'utf-8'))
37+
: null,
38+
)
3239
const agent = await detect({ programmatic: true })
33-
if (agent) {
34-
config = { ...defaultConfig, defaultAgent: agent }
35-
}
36-
else {
37-
config = Object.assign(
38-
{},
39-
defaultConfig,
40-
fs.existsSync(rcPath)
41-
? ini.parse(fs.readFileSync(rcPath, 'utf-8'))
42-
: null,
43-
)
44-
}
40+
if (agent)
41+
config.defaultAgent = agent
4542
}
4643

4744
return config

0 commit comments

Comments
 (0)
Please sign in to comment.