fiximports: Don't leave backup files on osx

This commit is contained in:
Łukasz Magiera 2022-06-14 18:31:33 +02:00
parent 3f0f5834b3
commit a7b695eac3

View File

@ -4,12 +4,14 @@ go_files() {
find . -type f -name \*.go -not -name \*_cbor_gen.go | grep -v './extern/filecoin-ffi' | grep -v './extern/test-vectors' find . -type f -name \*.go -not -name \*_cbor_gen.go | grep -v './extern/filecoin-ffi' | grep -v './extern/test-vectors'
} }
go_files | xargs -I '{}' sed -i -e '/import (/ { go_files | xargs -I '{}' sed -i.ifixbak -e '/import (/ {
:1 :1
$!N $!N
s/\n\n/\'$'\n''/ s/\n\n/\'$'\n''/
/)/!b1 /)/!b1
}' '{}' }' '{}'
find . -type f -name \*.go.ifixbak | xargs rm
go_files | xargs -I '{}' goimports -w -local "github.com/filecoin-project" '{}' go_files | xargs -I '{}' goimports -w -local "github.com/filecoin-project" '{}'
go_files | xargs -I '{}' goimports -w -local "github.com/filecoin-project/lotus" '{}' go_files | xargs -I '{}' goimports -w -local "github.com/filecoin-project/lotus" '{}'