From 0da9ff1a56f75e812f1b0b55f809e3ae8e1c5d18 Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Wed, 6 Mar 2024 10:41:10 +0100 Subject: [PATCH] Fix for non-vendor Go code --- main.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/main.go b/main.go index 9bd52f3..5865a39 100644 --- a/main.go +++ b/main.go @@ -206,16 +206,6 @@ func packageMainFile(mainFile string, packageDate string) error { return err } - _, vendorPathErr := os.Stat(copyDir + "/vendor") - hasVendorDir := vendorPathErr == nil - - if hasVendorDir { - err = deleteFilesWithoutGoExtension(copyDir + string(os.PathSeparator) + "vendor") - if err != nil { - return err - } - } - err = updateVeracodeJson(mainFile, parentDir, copyDir) if err != nil { return err @@ -276,6 +266,17 @@ func vendorDir(copyDir string) error { err = os.Rename(microsoftPath, newMicrosoftPath) } + if err != nil { + return err + } + + _, vendorPathErr = os.Stat(copyDir + "/vendor") + hasVendorDir := vendorPathErr == nil + + if hasVendorDir { + err = deleteFilesWithoutGoExtension(copyDir + string(os.PathSeparator) + "vendor") + } + return err }