chore: skip go mod if dry run

main
sudo pacman -Syu 2022-07-22 22:42:34 +07:00
parent febe519d27
commit 782526b08a
No known key found for this signature in database
GPG Key ID: D6CB5C6C567C47B0
1 changed files with 5 additions and 1 deletions

View File

@ -160,7 +160,7 @@ func (a *action) runUpgradeModule(
}
a.log("line: %s", modulePath)
// Check if line is imported module, otherwise skip
// Check if modulePath is imported module, otherwise skip
if _, ok := mapImportedModules[modulePath]; !ok {
a.log("%s is not imported module", modulePath)
return successUpgradedModules, nil
@ -206,6 +206,10 @@ func (a *action) runUpgradeModule(
}
func (a *action) runGoMod(c *cli.Context, existVendor bool) error {
if a.flags.dryRun {
return nil
}
// go mod tidy
goModArgs := []string{"mod", "tidy"}
goOutput, err := exec.CommandContext(c.Context, "go", goModArgs...).CombinedOutput()