You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.0 KiB
41 lines
1.0 KiB
open Fnm; |
|
open Lwt; |
|
|
|
let run = (~version) => { |
|
Versions.getInstalledVersions() |
|
>|= List.find_opt(x => Versions.Local.(x.name == version)) |
|
>>= ( |
|
installedVersion => |
|
switch (installedVersion) { |
|
| None => |
|
Logger.error( |
|
<Pastel> |
|
"The version " |
|
<Pastel color=Pastel.Cyan> version </Pastel> |
|
" is not installed." |
|
</Pastel>, |
|
); |
|
exit(1); |
|
| Some(installedVersion) => |
|
Logger.debug( |
|
<Pastel> |
|
"Uninstalling node " |
|
<Pastel color=Pastel.Cyan> |
|
Versions.Local.(installedVersion.name) |
|
</Pastel> |
|
</Pastel>, |
|
); |
|
let%lwt _ = Versions.Local.remove(installedVersion); |
|
Logger.info( |
|
<Pastel> |
|
"Node version " |
|
<Pastel color=Pastel.Cyan> |
|
Versions.Local.(installedVersion.name) |
|
</Pastel> |
|
" has correctly been removed." |
|
</Pastel>, |
|
) |
|
|> Lwt.return; |
|
} |
|
); |
|
};
|
|
|