def delete(backup) do
uploader = Pleroma.Config.get([Pleroma.Upload, :uploader])
- with :ok <- uploader.delete_file("backups/" <> backup.file_name) do
+ with :ok <- uploader.delete_file(Path.join("backups", backup.file_name)) do
Repo.delete(backup)
end
end
name: backup.file_name,
tempfile: zip_path,
content_type: backup.content_type,
- path: "backups/" <> backup.file_name
+ path: Path.join("backups", backup.file_name)
}
with {:ok, _} <- Pleroma.Uploaders.Uploader.put_file(uploader, upload),
UserView.render("user.json", %{user: user})
|> Map.merge(%{"likes" => "likes.json", "bookmarks" => "bookmarks.json"})
|> Jason.encode() do
- File.write(dir <> "/actor.json", json)
+ File.write(Path.join(dir, "actor.json"), json)
end
end
end
defp write(query, dir, name, fun) do
- path = dir <> "/#{name}.json"
+ path = Path.join(dir, "#{name}.json")
with {:ok, file} <- File.open(path, [:write, :utf8]),
:ok <- write_header(file, name) do