Makefile: convert generated files to native line-ends on Windows
Git wants to see native line-ends in source files, but the code generators we use always write UNIX line-ends. `make generate` on Windows now passes generated files through `unix2dos`. This allows regenerating files without Git listing them as modified.
This commit is contained in:
parent
eaeea38e3f
commit
42daa87839
5
Makefile
5
Makefile
@ -30,6 +30,11 @@ socketio-poc:
|
||||
generate:
|
||||
go generate ./pkg/api/...
|
||||
go generate ./internal/...
|
||||
# The generators always produce UNIX line-ends. This creates false file
|
||||
# modifications with Git. Convert them to DOS line-ends to avoid this.
|
||||
ifeq ($(OS),Windows_NT)
|
||||
git status --porcelain | grep '^ M .*.gen.go' | cut -d' ' -f3 | xargs unix2dos --keepdate
|
||||
endif
|
||||
|
||||
# resource.syso: resource/thermogui.ico resource/versioninfo.json
|
||||
# goversioninfo -icon=resource/thermogui.ico -64 resource/versioninfo.json
|
||||
|
Loading…
x
Reference in New Issue
Block a user