mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-04-22 12:10:17 +08:00
Use a non-hidden file to track if escript assets are extracted
When tmpdir is cleaned on macOS, files are removed, directories are kept, so we use an extra file as a flag to easily check if the files are extracted. However, files starting with dot are not removed as part of the cleanup, so we need to use a regular name.
This commit is contained in:
parent
d7a219e9d0
commit
edabdf9d84
1 changed files with 2 additions and 2 deletions
|
@ -85,7 +85,7 @@ defmodule LivebookCLI do
|
|||
|
||||
defp extract_priv!() do
|
||||
archive_dir = Path.join(Livebook.Config.tmp_path(), "escript")
|
||||
extracted_path = Path.join(archive_dir, ".extracted")
|
||||
extracted_path = Path.join(archive_dir, "extracted")
|
||||
in_archive_priv_path = ~c"livebook/priv"
|
||||
|
||||
# In dev we want to extract fresh directory on every boot
|
||||
|
@ -94,7 +94,7 @@ defmodule LivebookCLI do
|
|||
end
|
||||
|
||||
# When temporary directory is cleaned by the OS, the directories
|
||||
# may be left in place, so we use a regular file (.extracted) to
|
||||
# may be left in place, so we use a regular file (extracted) to
|
||||
# check if the extracted archive is already available
|
||||
if not File.exists?(extracted_path) do
|
||||
{:ok, sections} = :escript.extract(:escript.script_name(), [])
|
||||
|
|
Loading…
Add table
Reference in a new issue