Is globalAgent always use npm when run 'ni -g xxx' in project workspace?
aswind7 opened this issue · comments
aswind7 commented
when i run 'ni -g xxx' in a project workspace i see it always use npm, then i see the source code of src/config.ts.
I think it always excute config = { ...defaultConfig, defaultAgent: agent }
because agent always exists. And i want to know is it so? thanks.
export async function getConfig(): Promise<Config> {
if (!config) {
const agent = await detect({ programmatic: true })
if (agent)
config = { ...defaultConfig, defaultAgent: agent }
else
config = Object.assign({}, defaultConfig, ini.parse(fs.readFileSync(rcPath, 'utf-8')))
}
return config
}
Anthony Fu commented