fiximports script
This commit is contained in:
parent
016749b60b
commit
d929d7104f
5
Makefile
5
Makefile
@ -349,7 +349,10 @@ docsgen-openrpc-gateway: docsgen-openrpc-bin
|
|||||||
|
|
||||||
.PHONY: docsgen docsgen-md-bin docsgen-openrpc-bin
|
.PHONY: docsgen docsgen-md-bin docsgen-openrpc-bin
|
||||||
|
|
||||||
gen: actors-gen type-gen method-gen cfgdoc-gen docsgen api-gen circleci bundle-gen
|
fiximports:
|
||||||
|
./scripts/fiximports
|
||||||
|
|
||||||
|
gen: actors-gen type-gen method-gen cfgdoc-gen docsgen api-gen circleci bundle-gen fiximports
|
||||||
@echo ">>> IF YOU'VE MODIFIED THE CLI OR CONFIG, REMEMBER TO ALSO MAKE docsgen-cli"
|
@echo ">>> IF YOU'VE MODIFIED THE CLI OR CONFIG, REMEMBER TO ALSO MAKE docsgen-cli"
|
||||||
.PHONY: gen
|
.PHONY: gen
|
||||||
|
|
||||||
|
15
scripts/fiximports
Executable file
15
scripts/fiximports
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
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 -e '/import (/ {
|
||||||
|
:1
|
||||||
|
$!N
|
||||||
|
s/\n\n/\'$'\n''/
|
||||||
|
/)/!b1
|
||||||
|
}' '{}'
|
||||||
|
|
||||||
|
go_files | xargs -I '{}' goimports -w -local "github.com/filecoin-project" '{}'
|
||||||
|
go_files | xargs -I '{}' goimports -w -local "github.com/filecoin-project/lotus" '{}'
|
Loading…
Reference in New Issue
Block a user