Fix livebook path resolution in bin/notebook
Falls back to mix escripts directory when livebook isn't in PATH.
This commit is contained in:
parent
3cc4301855
commit
511ae09fea
1 changed files with 8 additions and 1 deletions
|
|
@ -11,6 +11,13 @@ COOKIE="microwaveprop_nb"
|
||||||
NODE="prop@$(hostname -s)"
|
NODE="prop@$(hostname -s)"
|
||||||
PORT="${LIVEBOOK_PORT:-8081}"
|
PORT="${LIVEBOOK_PORT:-8081}"
|
||||||
|
|
||||||
|
# Find livebook: PATH, then mix escripts dir
|
||||||
|
LIVEBOOK="$(command -v livebook 2>/dev/null || echo "$(elixir -e 'IO.write(Path.join(Mix.path_for(:escripts), "livebook"))')")"
|
||||||
|
if [ ! -x "$LIVEBOOK" ]; then
|
||||||
|
echo "Livebook not found. Install with: mix escript.install hex livebook"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Starting Phoenix on :4000 and Livebook on :${PORT}..."
|
echo "Starting Phoenix on :4000 and Livebook on :${PORT}..."
|
||||||
echo "Livebook will be at http://localhost:${PORT}"
|
echo "Livebook will be at http://localhost:${PORT}"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
@ -27,7 +34,7 @@ sleep 3
|
||||||
LIVEBOOK_HOME="$(pwd)/notebooks" \
|
LIVEBOOK_HOME="$(pwd)/notebooks" \
|
||||||
LIVEBOOK_APPS_PATH="$(pwd)/notebooks" \
|
LIVEBOOK_APPS_PATH="$(pwd)/notebooks" \
|
||||||
LIVEBOOK_APPS_PATH_HUB_ID="personal-hub" \
|
LIVEBOOK_APPS_PATH_HUB_ID="personal-hub" \
|
||||||
livebook server \
|
"$LIVEBOOK" server \
|
||||||
--port "$PORT" \
|
--port "$PORT" \
|
||||||
--default-runtime "attached:${NODE}:${COOKIE}" &
|
--default-runtime "attached:${NODE}:${COOKIE}" &
|
||||||
LIVEBOOK_PID=$!
|
LIVEBOOK_PID=$!
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue