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.
34 lines
727 B
34 lines
727 B
open Fnm; |
|
|
|
let run = (~name, ~version) => { |
|
let version = Versions.format(version); |
|
let versionPath = |
|
Filename.concat( |
|
Filename.concat(Directories.nodeVersions, version), |
|
"installation", |
|
); |
|
let%lwt versionInstalled = Lwt_unix.file_exists(versionPath); |
|
|
|
if (!versionInstalled) { |
|
Logger.error( |
|
<Pastel color=Pastel.Red> |
|
"Can't find a version installed in " |
|
versionPath |
|
</Pastel>, |
|
); |
|
exit(1); |
|
}; |
|
|
|
Logger.info( |
|
<Pastel> |
|
"Aliasing " |
|
<Pastel color=Pastel.Cyan> name </Pastel> |
|
" to " |
|
<Pastel color=Pastel.Cyan> version </Pastel> |
|
</Pastel>, |
|
); |
|
|
|
let%lwt () = Versions.Aliases.set(~alias=name, ~versionPath); |
|
|
|
Lwt.return(); |
|
};
|
|
|