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.
31 lines
672 B
31 lines
672 B
![]()
6 years ago
|
open Fnm;
|
||
|
|
||
|
let run = (~name, ~version) => {
|
||
|
let version = Versions.format(version);
|
||
|
let versionPath = Filename.concat(Directories.nodeVersions, version);
|
||
|
let%lwt versionInstalled = Lwt_unix.file_exists(versionPath);
|
||
|
|
||
|
if (!versionInstalled) {
|
||
|
Console.error(
|
||
|
<Pastel color=Pastel.Red>
|
||
|
"Can't find a version installed in "
|
||
|
versionPath
|
||
|
</Pastel>,
|
||
|
);
|
||
|
exit(1);
|
||
|
};
|
||
|
|
||
|
Console.log(
|
||
|
<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();
|
||
|
};
|