From fa163c2514961adf8fe06eec1b9f7537d25f2acd Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Thu, 6 Aug 2020 13:24:15 -0700 Subject: [PATCH] fix generator to work even in nested packer/packer dirs --- cmd/generate-fixer-deprecations/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/generate-fixer-deprecations/main.go b/cmd/generate-fixer-deprecations/main.go index 5804ef390..13b576d93 100644 --- a/cmd/generate-fixer-deprecations/main.go +++ b/cmd/generate-fixer-deprecations/main.go @@ -40,7 +40,8 @@ func main() { if err != nil { panic(err) } - paths := strings.SplitAfter(absFilePath, "packer"+string(os.PathSeparator)) + paths := strings.Split(absFilePath, "cmd"+string(os.PathSeparator)+ + "generate-fixer-deprecations"+string(os.PathSeparator)+"main.go") packerDir := paths[0] // Load all deprecated options from all active fixers