Skip to content

Commit

Permalink
fix: closing the file so that the CLI can delete it.
Browse files Browse the repository at this point in the history
- the wait wasn't the problem... forgot to close the file descriptor
  • Loading branch information
YairLevi committed Jan 28, 2024
1 parent 277ebe3 commit 2d2503f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cli/coffee/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"github.com/YairLevi/Coffee/cli/coffee/util"
"github.com/charmbracelet/log"
"os"
"time"
)

var sourceDirMapping = map[string]string{
Expand Down Expand Up @@ -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,
Expand All @@ -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 {
Expand Down

0 comments on commit 2d2503f

Please sign in to comment.