Do not symlink priv ()

This commit is contained in:
Jonatan Kłosko 2025-03-17 13:52:16 +01:00 committed by GitHub
parent 628272e8e1
commit 64b10e055f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 5 additions and 12 deletions

4
.gitignore vendored
View file

@ -33,7 +33,3 @@ npm-debug.log
# The built Escript
/livebook
# We generate priv when building release or escript
/priv/static
/priv/iframe_static

View file

@ -57,7 +57,6 @@ COPY config config
RUN mix do deps.get, deps.compile
# Compile and build the release
COPY priv/.gitkeep priv/.gitkeep
COPY rel rel
COPY static static
COPY iframe/priv/static/iframe iframe/priv/static/iframe

View file

@ -1,18 +1,16 @@
defmodule Mix.Tasks.Livebook.GenPriv do
@moduledoc false
# Note that we need to include priv/.gitkeep in Dockerfile and Hex
# package files, so that priv/ is symlinked within _build/, before
# we generate the actual files.
use Mix.Task
@gzippable_exts ~w(.js .css .txt .text .html .json .svg .eot .ttf)
@impl true
def run([]) do
compress_and_copy("static", "priv/static")
compress_and_copy("iframe/priv/static/iframe", "priv/iframe_static")
app_path = Mix.Project.app_path()
compress_and_copy("static", Path.join(app_path, "priv/static"))
compress_and_copy("iframe/priv/static/iframe", Path.join(app_path, "priv/iframe_static"))
end
defp compress_and_copy(source_dir, target_dir) do

View file

@ -59,7 +59,7 @@ defmodule Livebook.MixProject do
"GitHub" => "https://github.com/livebook-dev/livebook"
},
files:
~w(lib static priv/.gitkeep config mix.exs mix.lock README.md LICENSE CHANGELOG.md iframe/priv/static/iframe proto/lib)
~w(lib static config mix.exs mix.lock README.md LICENSE CHANGELOG.md iframe/priv/static/iframe proto/lib)
]
end

View file