Last active
June 8, 2023 07:46
-
-
Save olebedev/6d94df9d5d13ca23faea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PID = /tmp/awesome-golang-project.pid | |
GO_FILES = $(wildcard *.go) | |
serve: | |
@make restart | |
@fswatch -o . | xargs -n1 -I{} make restart || make kill | |
kill: | |
@kill `cat $(PID)` || true | |
stuff: | |
@echo "actually do nothing" | |
restart: | |
@make kill | |
@make stuff | |
@go run $(GO_FILES) & echo $$! > $(PID) | |
.PHONY: serve restart kill stuff # let's go to reserve rules names |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment