mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-21 23:56:30 +00:00
fix: skip directory entries
In OTP 27.1 or later, `:zip.unzip/2` without `:skip_directories` option returns directory entries. However in OTP 26, passing `:skip_directories` returns a `:bad_option` error, so this option is not available for compatibility.
This commit is contained in:
parent
d92d6132f2
commit
3f98c8bd1b
1 changed files with 5 additions and 2 deletions
|
@ -74,11 +74,14 @@ defmodule Pleroma.Frontend do
|
||||||
|
|
||||||
new_file_path = Path.join(dest, path)
|
new_file_path = Path.join(dest, path)
|
||||||
|
|
||||||
new_file_path
|
path
|
||||||
|> Path.dirname()
|
|> Path.dirname()
|
||||||
|
|> then(&Path.join(dest, &1))
|
||||||
|> File.mkdir_p!()
|
|> File.mkdir_p!()
|
||||||
|
|
||||||
File.write!(new_file_path, data)
|
if not File.dir?(new_file_path) do
|
||||||
|
File.write!(new_file_path, data)
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue