From b42874b967318813bc826d7d63c04083862fc31a Mon Sep 17 00:00:00 2001 From: Faissal Elamraoui Date: Sun, 4 Dec 2016 14:48:42 +0100 Subject: [PATCH] This fixes #330 Removes the generated temp directory to avoid fulling the /tmp after running bee pack a few times. --- pack.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pack.go b/pack.go index 4e16086..24fb789 100644 --- a/pack.go +++ b/pack.go @@ -495,6 +495,13 @@ func packApp(cmd *Command, args []string) int { tmpdir := path.Join(os.TempDir(), "beePack-"+str) os.Mkdir(tmpdir, 0700) + defer func() { + // Remove the tmpdir once bee pack is done + err := os.RemoveAll(tmpdir) + if err != nil { + logger.Error("Failed to remove the generated temp dir") + } + }() if build { logger.Info("Building application...")