cmd/abigen: allow using `abigen --pkg` flag with standard input (#19207)

pull/19632/head
Vitaly Bogdanov 5 years ago committed by Guillaume Ballet
parent c4de228e18
commit 5429dc75bd
  1. 11
      cmd/abigen/main.go

@ -81,7 +81,7 @@ func main() {
bins []string
types []string
)
if *solFlag != "" || *vyFlag != "" || (*abiFlag == "-" && *pkgFlag == "") {
if *solFlag != "" || *vyFlag != "" || *abiFlag == "-" {
// Generate the list of types to exclude from binding
exclude := make(map[string]bool)
for _, kind := range strings.Split(*excFlag, ",") {
@ -129,13 +129,8 @@ func main() {
}
} else {
// Otherwise load up the ABI, optional bytecode and type name from the parameters
var abi []byte
var err error
if *abiFlag == "-" {
abi, err = ioutil.ReadAll(os.Stdin)
} else {
abi, err = ioutil.ReadFile(*abiFlag)
}
abi, err := ioutil.ReadFile(*abiFlag)
if err != nil {
fmt.Printf("Failed to read input ABI: %v\n", err)
os.Exit(-1)

Loading…
Cancel
Save