Since Windows can't overwrite process files which are open, dsc upgrade would actually spawn a new dsc-upgrade executable and dsc would just exit. dsc-upgrade would take care of downloading to a temp location, checking if any instances of dsc are running (on Windows, Linux/macOS can skip this step) and prompt if any are running (either try again or abort which removes the temp files).
It may make sense to have dsc start a thread to always check if an update is available and suggest using this subcommand to update.
Summary of the new feature / enhancement
Similar to
rustup
, we should have:dsc upgrade [channel]
with
[channel]
:stable
,nightly
,preview
, or specific version also a--what-if
switch to just show upgrade info and not perform the upgradeProposed technical implementation details (optional)
Since Windows can't overwrite process files which are open,
dsc upgrade
would actually spawn a newdsc-upgrade
executable anddsc
would just exit.dsc-upgrade
would take care of downloading to a temp location, checking if any instances ofdsc
are running (on Windows, Linux/macOS can skip this step) and prompt if any are running (either try again or abort which removes the temp files).It may make sense to have
dsc
start a thread to always check if an update is available and suggest using this subcommand to update.