dev-tooling: Only restart Go services that actually changed
Created by: mrnugget
Before this change we would restart all the Go commands that we recompiled.
And we touched a file outside a ./cmd/
subfolder that would mean that
we recompile all Go commands and restart all of them.
Example: when you touched ./enterprise/internal/campaigns/types.go which is only used by frontend and repo-updater, we would compile and restart
- repo-updater
- frontend
- gitserver
- symbols
- query-runner
- github-proxy
- searcher
- replacer
With the change here, we use diff to check whether the binary actually changed and only restart the ones that did change.
For the same example that means we would still recompile all of them but only restart:
- repo-updater
- frontend
And: symbols, because symbols somehow always changes its binary. I suspect this has to do with CGO?
Anyhow: this should be a good improvement for dev workflows.
Happy about any feedback on my Bash code :)