diff --git a/executable/Install.re b/executable/Install.re index cc0b2dd..24d15f7 100644 --- a/executable/Install.re +++ b/executable/Install.re @@ -93,6 +93,15 @@ let run = (~version) => , ) |> Lwt.return + | Versions.Already_installed(version) => + Console.log( + + "Version " + version + " is already installed." + , + ) + |> Lwt.return | Versions.Version_not_found(version) => Console.log( diff --git a/feature_tests/existing_installation/run.sh b/feature_tests/existing_installation/run.sh new file mode 100644 index 0000000..15f810f --- /dev/null +++ b/feature_tests/existing_installation/run.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +eval `fnm env` + +fnm install v8.11.3 +fnm install v8.11.3 | grep "already installed" + +if [ "$?" != "0" ]; then + echo "The second installation should say it is already installed" + exit 1 +fi