mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-07 21:44:36 +08:00
Fix Teams app deployments with attachment files
This commit is contained in:
parent
50b60f0a4f
commit
57ef44278b
2 changed files with 5 additions and 0 deletions
|
@ -58,6 +58,8 @@ defimpl Livebook.Apps.AppSpec, for: Livebook.Apps.TeamsAppSpec do
|
|||
end
|
||||
|
||||
defp unzip(archive_binary, files_tmp_path) do
|
||||
File.mkdir_p!(files_tmp_path)
|
||||
|
||||
case :zip.extract(archive_binary, [:memory]) do
|
||||
{:ok, entries} ->
|
||||
Enum.reduce_while(entries, {:error, "notebook file missing in the app archive"}, fn
|
||||
|
|
|
@ -633,12 +633,15 @@ defmodule Livebook.Hubs.TeamClientTest do
|
|||
notebook = %{
|
||||
Livebook.Notebook.new()
|
||||
| app_settings: %{Livebook.Notebook.AppSettings.new() | slug: slug},
|
||||
file_entries: [%{type: :attachment, name: "image.jpg"}],
|
||||
name: title,
|
||||
hub_id: team.id,
|
||||
deployment_group_id: deployment_group_id
|
||||
}
|
||||
|
||||
files_dir = Livebook.FileSystem.File.local(tmp_dir)
|
||||
image_file = Livebook.FileSystem.File.resolve(files_dir, "image.jpg")
|
||||
:ok = Livebook.FileSystem.File.write(image_file, "content")
|
||||
|
||||
{:ok, %Livebook.Teams.AppDeployment{file: zip_content} = app_deployment} =
|
||||
Livebook.Teams.AppDeployment.new(notebook, files_dir)
|
||||
|
|
Loading…
Add table
Reference in a new issue