Skip to content

Commit

Permalink
Removed dangerous rm -rf ./bin (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
fde-capu authored Mar 28, 2024
1 parent 70b9e93 commit e852aac
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# Define variables
GOBIN := ./bin
GOBIN := ./bin/navi
GOPACKAGES := $(shell go list ./... | grep -v /vendor)

# Build command
build:
go build -o $(GOBIN)/navi ./main.go
-mkdir -p ./bin
go build -o $(GOBIN) ./main.go

# Run command
run: build
$(GOBIN)/navi
$(GOBIN)

# Test command (assuming you have unit tests)
test:
go test -v $(GOPACKAGES)

# Clean command
clean:
rm -rf $(GOBIN)
rm $(GOBIN) # This was too dengerous when $(GOBIN) was only './bin'!

# Live reload command (optional)
livereload:
Expand Down

0 comments on commit e852aac

Please sign in to comment.