mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-04 12:04:20 +08:00
Use absolute paths in livebook.gen_priv so it works in nerves_livebook
This commit is contained in:
parent
264126eaae
commit
28bbca9b0a
1 changed files with 10 additions and 3 deletions
|
@ -7,10 +7,17 @@ defmodule Mix.Tasks.Livebook.GenPriv do
|
|||
|
||||
@impl true
|
||||
def run([]) do
|
||||
app_path = Mix.Project.app_path()
|
||||
# Use absolute paths, instead of relying on the current mix project,
|
||||
# so the task can be invoked by nerves_livebook.
|
||||
app_path = Application.app_dir(:livebook)
|
||||
project_dir = Path.expand("../../..", __DIR__)
|
||||
|
||||
compress_and_copy("static", Path.join(app_path, "priv/static"))
|
||||
compress_and_copy("iframe/priv/static/iframe", Path.join(app_path, "priv/iframe_static"))
|
||||
compress_and_copy(Path.join(project_dir, "static"), Path.join(app_path, "priv/static"))
|
||||
|
||||
compress_and_copy(
|
||||
Path.join(project_dir, "iframe/priv/static/iframe"),
|
||||
Path.join(app_path, "priv/iframe_static")
|
||||
)
|
||||
end
|
||||
|
||||
defp compress_and_copy(source_dir, target_dir) do
|
||||
|
|
Loading…
Add table
Reference in a new issue