v1.27.0-a #10

Closed
jonathanface wants to merge 473 commits from v1.27.0-a into master
Showing only changes of commit 91fd0ec101 - Show all commits

View File

@ -1,17 +1,22 @@
#!/usr/bin/env bash
sed_replace='/import (/ {
:1
$!N
s/\n\n/\'$'\n''/
/)/!b1
}'
go_files() {
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.ifixbak -e '/import (/ {
:1
$!N
s/\n\n/\'$'\n''/
/)/!b1
}' '{}'
find . -type f -name \*.go.ifixbak | xargs rm
# Because -i works differently on macOS, we need to use a different sed command
if [[ "$OSTYPE" == "darwin"* ]]; then
go_files | xargs -I '{}' sed -i '' -e "$sed_replace" '{}'
else
go_files | xargs -I '{}' sed -i -e "$sed_replace" '{}'
fi
go_files | xargs -I '{}' goimports -w -local "github.com/filecoin-project" '{}'
go_files | xargs -I '{}' goimports -w -local "github.com/filecoin-project/lotus" '{}'