From 02c8bf5b31953a016d3f26ae3a6c07045ae923ff Mon Sep 17 00:00:00 2001 From: Guillaume Ballet Date: Mon, 16 Dec 2019 10:20:01 +0100 Subject: [PATCH] Review feedback: handle full paths --- cmd/abigen/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/abigen/main.go b/cmd/abigen/main.go index fd7b67fce8..ed4a3b8870 100644 --- a/cmd/abigen/main.go +++ b/cmd/abigen/main.go @@ -21,6 +21,7 @@ import ( "fmt" "io/ioutil" "os" + "path/filepath" "regexp" "strings" @@ -204,7 +205,8 @@ func abigen(c *cli.Context) error { // Sanitize the combined json names to match the // format expected by solidity. if !strings.Contains(n, ":") { - name = abi.ToCamelCase(strings.TrimSuffix(name, ".vy")) + // Remove extra path components + name = abi.ToCamelCase(strings.TrimSuffix(filepath.Base(name), ".vy")) } contracts[name] = contract }