Skip to content

Commit

Permalink
fix: allow to use anywhere
Browse files Browse the repository at this point in the history
Signed-off-by: Norman Meier <[email protected]>
  • Loading branch information
n0izn0iz committed Nov 7, 2024
1 parent 851a8a7 commit 76fa49c
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions gnovm/cmd/gno/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@ func execClean(cfg *cleanCfg, args []string, io commands.IO) error {
return flag.ErrHelp
}

if cfg.modCache {
modCacheDir := gnomod.GetGnoModPath()
if !cfg.dryRun {
if err := os.RemoveAll(modCacheDir); err != nil {
return err
}

Check warning on line 71 in gnovm/cmd/gno/clean.go

View check run for this annotation

Codecov / codecov/patch

gnovm/cmd/gno/clean.go#L67-L71

Added lines #L67 - L71 were not covered by tests
}
if cfg.dryRun || cfg.verbose {
io.Println("rm -rf", modCacheDir)
}
return nil

Check warning on line 76 in gnovm/cmd/gno/clean.go

View check run for this annotation

Codecov / codecov/patch

gnovm/cmd/gno/clean.go#L73-L76

Added lines #L73 - L76 were not covered by tests
}

path, err := os.Getwd()
if err != nil {
return err
Expand All @@ -80,17 +93,6 @@ func execClean(cfg *cleanCfg, args []string, io commands.IO) error {
return err
}

if cfg.modCache {
modCacheDir := gnomod.GetGnoModPath()
if !cfg.dryRun {
if err := os.RemoveAll(modCacheDir); err != nil {
return err
}
}
if cfg.dryRun || cfg.verbose {
io.Println("rm -rf", modCacheDir)
}
}
return nil
}

Expand Down

0 comments on commit 76fa49c

Please sign in to comment.