From 717d3755b42ef5184b330ad8cc0d3e49d196c189 Mon Sep 17 00:00:00 2001 From: Pierre Cavin Date: Sat, 21 Dec 2024 18:22:44 +0100 Subject: [PATCH] feat: add `run_lts/2` and `install_and_run_lts/2` --- lib/nodelix.ex | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/nodelix.ex b/lib/nodelix.ex index b028663..b053969 100644 --- a/lib/nodelix.ex +++ b/lib/nodelix.ex @@ -112,6 +112,13 @@ defmodule Nodelix do |> elem(1) end + @doc """ + Same as `run/3` but using the latest known LTS version at the time of publishing. + """ + def run_lts(profile, extra_args \\ []) when is_atom(profile) and is_list(extra_args) do + run(VersionManager.latest_lts_version(), profile, extra_args) + end + @doc """ Installs Node.js if the configured version is not available, and then runs `node`. @@ -125,4 +132,12 @@ defmodule Nodelix do run(version, profile, args) end + + @doc """ + Same as `install_and_run/3` but using the latest known LTS version at the time of publishing. + """ + def install_and_run_lts(profile, extra_args \\ []) + when is_atom(profile) and is_list(extra_args) do + install_and_run(VersionManager.latest_lts_version(), profile, extra_args) + end end