Skip to content

Commit

Permalink
Launcher improvements
Browse files Browse the repository at this point in the history
 * Silenced commands that check for asdf / rtx
 * allowed a command line option of 'iex' so you can start iex rather
   than elixir for testing
  • Loading branch information
scohen committed Aug 10, 2023
1 parent 9d8e4e6 commit 20428e2
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions bin/start_lexical.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env bash

set_up_version_manager() {
if [ -e $HOME/.asdf ] && asdf which elixir -eq 0; then
if [ -e $HOME/.asdf ] && asdf which elixir > /dev/null -eq 0; then
VERSION_MANAGER="asdf"
elif [ -e $HOME/.rtx ] && rtx which elixir -eq 0; then
elif [ -e $HOME/.rtx ] && rtx which elixir > /dev/null -eq 0; then
VERSION_MANAGER="rtx"
else
VERSION_MANAGER="none"
Expand All @@ -25,12 +25,20 @@ case "$VERSION_MANAGER" in
;;
esac

case $1 in
iex)
ELIXIR_COMMAND=iex
;;
*)
ELIXIR_COMMAND=elixir
;;
esac

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

export ERL_LIBS="${SCRIPT_DIR}/../lib"
elixir -pa "${SCRIPT_DIR}/../consolidated" \
-pa "${SCRIPT_DIR}/../config/" \
-pa "${SCRIPT_DIR}/../priv/" \
--eval "LXical.Server.Boot.start" \
--no-halt
"${ELIXIR_COMMAND}" -pa "${SCRIPT_DIR}/../consolidated" \
-pa "${SCRIPT_DIR}/../config/" \
-pa "${SCRIPT_DIR}/../priv/" \
--eval "LXical.Server.Boot.start" \
--no-halt

0 comments on commit 20428e2

Please sign in to comment.