Skip to content

Commit

Permalink
Fix for non-vendor Go code
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy Baukema committed Mar 6, 2024
1 parent dfc47cc commit 0da9ff1
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 0da9ff1

Please sign in to comment.