From 3cc0d94cd452aeaba38d9c2766ef927b2eeeba98 Mon Sep 17 00:00:00 2001 From: Joao P Dubas Date: Wed, 30 Oct 2024 18:41:50 +0000 Subject: [PATCH] chore: allow to override erlang and elixir used to compile elixirls With this change, it's possible to override the `erlang` and `elixir` versions used to compile `elixir-ls`. For example, to compile v0.24.1 with erlang 27.1.2 and elixir 1.17.3, run the following: ```bash ./elixir-ls-setup.sh v0.24.1 27.1.2 1.17.3 ``` --- scripts/elixir-ls-setup.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/elixir-ls-setup.sh b/scripts/elixir-ls-setup.sh index 9da234c..2c8dd56 100755 --- a/scripts/elixir-ls-setup.sh +++ b/scripts/elixir-ls-setup.sh @@ -10,6 +10,14 @@ function setup() { git checkout tags/${1} echo "set erlang/elixir versions" cp .release-tool-versions .tool-versions + if [[ ! -z "$2" ]]; then + echo "override erlang to ${2}" + sed -i "s/erlang .*/erlang ${2}/g" .tool-versions + fi + if [[ ! -z "$3" ]]; then + echo "override elixir to ${3}" + sed -i "s/elixir .*/elixir ${3}/g" .tool-versions + fi local current_erlang=$(mise current erlang) local current_elixir=$(mise current elixir) echo "using erlang ${current_erlang} / elixir ${current_elixir}" @@ -27,4 +35,4 @@ function setup() { git checkout master } -setup $1 +setup $1 $2 $3