Skip to content

Commit

Permalink
feat: add run_lts/2 and install_and_run_lts/2
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerlox committed Dec 21, 2024
1 parent 337e427 commit 717d375
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/nodelix.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand All @@ -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

0 comments on commit 717d375

Please sign in to comment.