Notify user when a newer version of medic-conf exists
What feature do you want to improve? We know from NPM stats the not many users are on a recent version of medic-conf. It's possible users don't know a new version exists.
Describe the improvement you'd like When running any command notify the user if a new version exists.
Describe alternatives you've considered Leave it - if it's working for users then maybe it's fine?
Additional context
- Log it last so it's visible when all the actions are complete.
- Make sure it's not alarming or annoying - a gentle reminder is what we're after.
- Make sure it doesn't slow down execution - run the query in parallel and discard it if doesn't complete before the rest of the actions.
I would add 2 more considerations for Additional context:
- Add a flag to skip the check, so specially for CI environments the check can be avoided. Actually skipping the check when either
--skip-dependency-checkor--forceflags are passed could be enough. - Create a kind of temp file, eg.
/tmp/medic-conf/last-executionwhere the last execution is saved, so subsequent executions check first the flag file to avoid spamming the user too much, or check how other tools that also needs updates likenvmornpmavoid the spamming and replicate the same behavior. When I say spam is not that can be annoying to see the new version notice each day but each time, eg. execute the CLI and then execute it again just 20 sec later.
Today I got this message in my bash console, only the first time I opened a session:
npm notice
npm notice New minor version of npm available! 7.7.6 -> 7.8.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.8.0
npm notice Run npm install -g [email protected] to update!
npm notice
$
I couldn't find the line in my ~/.bashrc file that executes the check, so not sure how it works, but interesting.