From 2d2503fbc86aaa25d2deb5b5f3b3a02536df54ab Mon Sep 17 00:00:00 2001 From: Yair Levi Date: Sun, 28 Jan 2024 22:14:06 +0200 Subject: [PATCH] fix: closing the file so that the CLI can delete it. - the wait wasn't the problem... forgot to close the file descriptor --- cli/coffee/build.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cli/coffee/build.go b/cli/coffee/build.go index 4c774f4..9b5ddb5 100644 --- a/cli/coffee/build.go +++ b/cli/coffee/build.go @@ -4,7 +4,6 @@ import ( "github.com/YairLevi/Coffee/cli/coffee/util" "github.com/charmbracelet/log" "os" - "time" ) var sourceDirMapping = map[string]string{ @@ -49,11 +48,12 @@ func Build() { } log.Info("Preparing for bundle") - _, err = os.Create("src/main/resources/__jar__") + file, err := os.Create("src/main/resources/__jar__") if err != nil { log.Errorf("Unexpected error: production flag was not able to set. %v", err) return } + file.Close() _, err = RunCommand(CmdProps{ Cmd: BundleApp, @@ -66,7 +66,6 @@ func Build() { return } - time.Sleep(500 * time.Millisecond) log.Info("Post bundle cleanup") err = os.Remove("src/main/resources/__jar__") if err != nil {