Skip to content

Commit

Permalink
remove Settings.default_file_system_home and replace default_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
ByeongUkChoi committed Jul 11, 2023
1 parent 08d0c0b commit a224f8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 2 additions & 10 deletions lib/livebook/settings.ex
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,6 @@ defmodule Livebook.Settings do
end
end

@doc """
Returns the home directory in the default file system.
"""
@spec default_file_system_home() :: FileSystem.File.t()
def default_file_system_home() do
get_default_dir()
end

@doc """
Sets default directory.
"""
Expand All @@ -272,8 +264,8 @@ defmodule Livebook.Settings do
@doc """
Gets default directory.
"""
@spec get_default_dir() :: FileSystem.File.t()
def get_default_dir() do
@spec default_dir() :: FileSystem.File.t()
def default_dir() do
with {:ok, %{file_system_id: file_system_id, path: path}} <-
Storage.fetch_key(:settings, "global", :default_dir),
file_system when file_system != nil <-
Expand Down
2 changes: 1 addition & 1 deletion lib/livebook_web/live/open_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ defmodule LivebookWeb.OpenLive do
end
end

defp file_from_params(_params), do: Livebook.Settings.default_file_system_home()
defp file_from_params(_params), do: Livebook.Settings.default_dir()

defp import_source(socket, source, session_opts) do
{notebook, %{warnings: messages}} = Livebook.LiveMarkdown.notebook_from_livemd(source)
Expand Down

0 comments on commit a224f8e

Please sign in to comment.