From 6837a2f449ff49b56107f2a5a64c118ed7af2ed7 Mon Sep 17 00:00:00 2001 From: AviKav Date: Wed, 31 Jan 2024 03:47:02 -0500 Subject: [PATCH] Support .livebookdesktop.{sh,bat} setting LIVEBOOK_NODE/RELEASE_NODE & LIVEBOOK_SHUTDOWN_ENABLED (#2464) --- rel/app/env.bat.eex | 5 +++-- rel/app/env.sh.eex | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/rel/app/env.bat.eex b/rel/app/env.bat.eex index c6a95cf61..b471d30b8 100644 --- a/rel/app/env.bat.eex +++ b/rel/app/env.bat.eex @@ -2,11 +2,12 @@ if exist "!USERPROFILE!\.livebookdesktop.bat" ( call "!USERPROFILE!\.livebookdesktop.bat" ) -set RELEASE_NODE=livebook_app +if defined LIVEBOOK_NODE set RELEASE_NODE="!LIVEBOOK_NODE!" +if not defined RELEASE_NODE set RELEASE_NODE=livebook_server set RELEASE_MODE=interactive set MIX_ARCHIVES=!RELEASE_ROOT!\vendor\archives set MIX_REBAR3=!RELEASE_ROOT!\vendor\rebar3 -set LIVEBOOK_SHUTDOWN_ENABLED=true +if not defined LIVEBOOK_SHUTDOWN_ENABLED set LIVEBOOK_SHUTDOWN_ENABLED=true set LIVEBOOK_DESKTOP=true if not defined LIVEBOOK_PORT (set LIVEBOOK_PORT=0) set PATH=!RELEASE_ROOT!\vendor\otp\erts-<%= @release.erts_version%>\bin;!RELEASE_ROOT!\vendor\otp\bin;!RELEASE_ROOT!\vendor\elixir\bin;!PATH! diff --git a/rel/app/env.sh.eex b/rel/app/env.sh.eex index 2a424b982..74ada85c3 100644 --- a/rel/app/env.sh.eex +++ b/rel/app/env.sh.eex @@ -8,11 +8,11 @@ if [[ "$hostname" =~ " " ]]; then exit 1 fi -export RELEASE_NODE=livebook_app +export RELEASE_NODE=${LIVEBOOK_NODE:-${RELEASE_NODE:-livebook_app}} export RELEASE_MODE=interactive export MIX_ARCHIVES="${RELEASE_ROOT}/vendor/archives" export MIX_REBAR3="${RELEASE_ROOT}/vendor/rebar3" -export LIVEBOOK_SHUTDOWN_ENABLED=true +export LIVEBOOK_SHUTDOWN_ENABLED=${LIVEBOOK_SHUTDOWN_ENABLED:-true} export LIVEBOOK_DESKTOP=true [ -z "$LIVEBOOK_PORT" ] && export LIVEBOOK_PORT=0 export PATH="$RELEASE_ROOT/vendor/otp/erts-<%= @release.erts_version%>/bin:$RELEASE_ROOT/vendor/otp/bin:$RELEASE_ROOT/vendor/elixir/bin:$PATH"