From 8101fd1881e0afd42cab6464d2a0e770ac435680 Mon Sep 17 00:00:00 2001 From: Fabian Stegemann Date: Thu, 3 Dec 2020 18:31:10 +0100 Subject: [PATCH] use ASDF_DIR variable to support Homebrew installs (#428) Currently the `launch.sh` script will check for asdf in my home directory. As I am a Homebrew user, my asdf got installed to `/usr/local/opt/asdf`. For `launch.sh` to be able to detect it I've modified it for the use of `ASDF_DIR` if available and fall-back to the current behaviour if that's not set. asdf will set the [`ASDF_DIR` (see upstream source)][1] variable when it initializes, so this seems to be a reliable way to detect all sorts of customized asdf installations. [1]: https://github.com/asdf-vm/asdf/blob/master/asdf.sh#L14 --- apps/elixir_ls_utils/priv/launch.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/elixir_ls_utils/priv/launch.sh b/apps/elixir_ls_utils/priv/launch.sh index f9626cfc..9a20b83f 100755 --- a/apps/elixir_ls_utils/priv/launch.sh +++ b/apps/elixir_ls_utils/priv/launch.sh @@ -11,7 +11,9 @@ did_relaunch=$1 -asdf_vm="${HOME}/.asdf/asdf.sh" +ASDF_DIR=${ASDF_DIR:-"${HOME}/.asdf"} + +asdf_vm="${ASDF_DIR}/asdf.sh" if test -f "${asdf_vm}" then # asdf-vm does not support the plain posix shell. Figure out