dfinity / dfxvm

dfx version manager
Apache License 2.0
7 stars 5 forks source link

feat: dfxvm uninstall #15

Closed ericswanson-dfinity closed 10 months ago

ericswanson-dfinity commented 10 months ago

Description

Adds the dfxvm uninstall commmand.

Note that the command doesn't do anything special if the version to be uninstalled happens to be the default version. This is intentional (and happens to be consistent with rustup toolchain uninstall, not that it matters too much). A later attempt to call dfx will display an error message with the dfxvm install command to re-install.

Fixes https://dfinity.atlassian.net/browse/SDK-1269

How Has This Been Tested?

Added tests, and manually

$ dfxvm install 0.13.1
info: installing dfx 0.13.1
info: downloading ...
info: installed dfx 0.13.1
$ dfx +0.13.1 --version
dfx 0.13.1
$ dfxvm uninstall 0.13.1
info: uninstalling dfx 0.13.1
info: uninstalled dfx 0.13.1
$ dfx +0.13.1 --version 
error: dfx 0.13.1 is not installed.  To install it, run:
error:     dfxvm install 0.13.1
$ dfxvm uninstall 0.13.1
info: dfx 0.13.1 is not installed

Checklist: