Created
April 15, 2020 12:51
-
-
Save klingtnet/03f11a4c9a04a48985af51c3ec5badc9 to your computer and use it in GitHub Desktop.
Restart a Go web service on file change
This file contains hidden or 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
#!/bin/sh | |
set -euo pipefail | |
command -v reflex &>/dev/null || { cat <<HEREDOC | |
Please install reflex: | |
go get -u github.com/cespare/reflex | |
HEREDOC | |
exit 1 | |
} | |
reflex --start-service -- go run ./cmd/server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Test and run: