Skip to content

Commit

Permalink
Remove lottie conversion temp dir after converting
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Feb 15, 2023
1 parent a28735b commit 8399330
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions attachments.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ func (br *DiscordBridge) convertLottie(data []byte) ([]byte, string, error) {
if err != nil {
return nil, "", fmt.Errorf("failed to create temp dir: %w", err)
}
defer func() {
removErr := os.RemoveAll(tempdir)
if removErr != nil {
br.Log.Warnfln("Failed to delete lottie conversion temp dir: %v", removErr)
}
}()

lottieOutput := filepath.Join(tempdir, "out_")
if lottieTarget != "pngs" {
Expand Down

0 comments on commit 8399330

Please sign in to comment.