File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed
Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change 1- .PHONY : go-mod-download
2- go-mod-download :
3- @cp ./go.mod.tpl ./go.mod
4- @go mod download
5-
6- .PHONY : go-mod-outdated
7- go-mod-outdated : go-mod-download
8- @# https://stackoverflow.com/questions/55866604/whats-the-go-mod-equivalent-of-npm-outdated
9- @# Since go 1.21, this command will exit 2 when one of the dependencies require a go version newer than us.
10- @# This implies we have to use the latest verion of Go whenever possible.
11- @go list -u -m -f ' {{if .Update}}{{if not .Indirect}}{{.}}{{end}}{{end}}' all
12-
131.PHONY : check-if-new-version-available
142check-if-new-version-available :
3+ @cp ./go.mod.tpl ./go.mod
4+ @go mod download
155 @# If grep matches something, it exits 0, otherwise it exits 1.
166 @# In our case, we want to invert the exit code.
17- $( MAKE ) go-mod-outdated | grep " ." ; status_code=$$? ; if [ $$ status_code -eq 0 ]; then exit 1; else exit 0; fi ;
7+ go list -u -m -f ' {{if .Update}}{{if not .Indirect}}{{.}}{{end}}{{end}} ' all | grep " ." ; status_code=$$? ; if [ $$ status_code -eq 0 ]; then exit 1; else exit 0; fi ;
You can’t perform that action at this time.
0 commit comments