Skip to content

Commit

Permalink
Fixed: Lecxical won't reliably start under asdf (#117)
Browse files Browse the repository at this point in the history
The launcher script wasn't starting with the correct environment
variables, which caused the default MIX_HOME (~/.mix) to be
selected. If this didn't exist, lexical would crash on start with a
badmatch error.

Fixes #116
  • Loading branch information
scohen authored Apr 25, 2023
1 parent 324ffe0 commit 9088f80
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions rel/deploy/overlays/start_lexical.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
#!/bin/sh
#!/usr/bin/env bash

set_up_version_manager() {
if [ -e $HOME/.asdf ]; then
VERSION_MANAGER="asdf"
elif [ -e $HOME/.rtx ]; then
VERSION_MANAGER="rtx"
else
VERSION_MANAGER="none"
fi
}

readlink_f () {
cd "$(dirname "$1")" > /dev/null || exit 1
filename="$(basename "$1")"
Expand All @@ -15,5 +26,16 @@ else
dir=${ELS_INSTALL_PREFIX}
fi

set_up_version_manager

exec "${dir}/bin/lexical" start
case "$VERSION_MANAGER" in
asdf)
asdf env elixir "${dir}/bin/lexical" start
;;
rtx)
rtx env -s bash elixir "${dir}/bin/lexical" start
;;
*)
"${dir}/bin/lexical" start
;;
esac

0 comments on commit 9088f80

Please sign in to comment.