cli icon indicating copy to clipboard operation
cli copied to clipboard

Cleanup - detached commands should get config passed to them

Open acoates-ms opened this issue 5 years ago • 3 comments

With #1231 the doctor command now uses the config when run in a non-detached manor. But since doctor is a detached command it doesn't get the config from the CLIs main loadConfig call passed to it. So, doctor ends up having to call loadConfig again.

This is mostly just a minor performance issue. But we could fix it by passing the config along to detached commands, -- or null if it is running detached. I don't think this would be a compat issue, since all the detached commands are internal to the CLI currently.

acoates-ms avatar Aug 28 '20 16:08 acoates-ms

Sounds good. I'll tackle it while working on my commander update.

grabbou avatar Nov 26 '20 11:11 grabbou

Update: Right now, doctor command added certain properties to config, such as healthchecks that can be set by user/dependency.

The idea here would be to provide a new function on top of loadConfig, called loadUserConfig or loadAdditionalConfig that would allow loading a custom, command-specific, additional properties, without needing to update the main package.

If, a doctor commandwants to use and set an additionalhealth checksvalue, it doesn't need to interfere withconfig` (main), it can simply use that function instead.

grabbou avatar Jan 26 '22 10:01 grabbou

#1527 as it's related.

grabbou avatar Jan 26 '22 10:01 grabbou

There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.

github-actions[bot] avatar Nov 27 '22 03:11 github-actions[bot]