Allow release to boot even if it can't write (#1568)

This allows Livebook to run even from .dmg files.
This commit is contained in:
José Valim 2022-12-11 17:06:00 +01:00 committed by GitHub
parent 3131610ad8
commit 00a7201f8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View file

@ -1,7 +1,7 @@
defmodule Livebook.MixProject do
use Mix.Project
@elixir_requirement "~> 1.14.2"
@elixir_requirement "~> 1.14.2 or ~> 1.15-dev"
@version "0.8.0"
@description "Interactive and collaborative code notebooks - made with Phoenix LiveView"

View file

@ -8,7 +8,8 @@ export LIVEBOOK_PORT=0
cookie_path="${RELEASE_ROOT}/releases/COOKIE"
if [ ! -f $cookie_path ]; then
cat /dev/urandom | env LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 > $cookie_path
RELEASE_COOKIE=$(cat /dev/urandom | env LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
[[ $RELEASE_COOKIE > $cookie_path ]] || export RELEASE_COOKIE
fi
cd $HOME

View file

@ -3,5 +3,6 @@ export RELEASE_MODE=interactive
cookie_path="${RELEASE_ROOT}/releases/COOKIE"
if [ ! -f $cookie_path ]; then
cat /dev/urandom | env LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 > $cookie_path
RELEASE_COOKIE=$(cat /dev/urandom | env LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
[[ $RELEASE_COOKIE > $cookie_path ]] || export RELEASE_COOKIE
fi