mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-25 12:56:13 +08:00
Remove leftovers in case assets extraction fails (#1020)
This commit is contained in:
parent
3f872816ee
commit
ca0128d028
1 changed files with 8 additions and 1 deletions
|
|
@ -1307,7 +1307,14 @@ defmodule Livebook.Session do
|
|||
end
|
||||
|
||||
defp extract_archive!(binary, path) do
|
||||
:ok = :erl_tar.extract({:binary, binary}, [:compressed, {:cwd, String.to_charlist(path)}])
|
||||
case :erl_tar.extract({:binary, binary}, [:compressed, {:cwd, String.to_charlist(path)}]) do
|
||||
:ok ->
|
||||
:ok
|
||||
|
||||
{:error, reason} ->
|
||||
File.rm_rf!(path)
|
||||
raise "failed to extract archive to #{path}, reason: #{inspect(reason)}"
|
||||
end
|
||||
end
|
||||
|
||||
@doc """
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue