mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-06 19:46:00 +08:00
Create home and data_path directories if missing (#1003)
* Create home and data_path directories if missing * Update lib/livebook/config.ex * Configure project-local data path for dev and test env * Expand dev/test paths in compile config Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
This commit is contained in:
parent
8836d6908c
commit
2c271e2efb
3 changed files with 12 additions and 2 deletions
|
@ -71,3 +71,5 @@ config :phoenix, :plug_init_mode, :runtime
|
|||
|
||||
# Disable authentication mode during dev
|
||||
config :livebook, :authentication_mode, :disabled
|
||||
|
||||
config :livebook, :data_path, Path.expand("tmp/livebook_data/dev")
|
||||
|
|
|
@ -14,6 +14,8 @@ config :logger, level: :warn
|
|||
# Disable authentication mode during test
|
||||
config :livebook, :authentication_mode, :disabled
|
||||
|
||||
config :livebook, :data_path, Path.expand("tmp/livebook_data/test")
|
||||
|
||||
# Use the embedded runtime in tests by default, so they
|
||||
# are cheaper to run. Other runtimes can be tested by starting
|
||||
# and setting them explicitly
|
||||
|
|
|
@ -6,7 +6,8 @@ defmodule Livebook.Application do
|
|||
use Application
|
||||
|
||||
def start(_type, _args) do
|
||||
ensure_local_filesystem!()
|
||||
ensure_directories!()
|
||||
set_local_filesystem!()
|
||||
ensure_distribution!()
|
||||
validate_hostname_resolution!()
|
||||
set_cookie()
|
||||
|
@ -55,7 +56,12 @@ defmodule Livebook.Application do
|
|||
:ok
|
||||
end
|
||||
|
||||
defp ensure_local_filesystem!() do
|
||||
defp ensure_directories!() do
|
||||
File.mkdir_p!(Livebook.Config.home())
|
||||
File.mkdir_p!(Livebook.Config.data_path())
|
||||
end
|
||||
|
||||
defp set_local_filesystem!() do
|
||||
home =
|
||||
Livebook.Config.home()
|
||||
|> Livebook.FileSystem.Utils.ensure_dir_path()
|
||||
|
|
Loading…
Add table
Reference in a new issue