From 76fa49cd5a59f92a4f5bad411e4e0e2147b6e8fe Mon Sep 17 00:00:00 2001 From: Norman Meier Date: Thu, 7 Nov 2024 01:26:32 +0100 Subject: [PATCH] fix: allow to use anywhere Signed-off-by: Norman Meier --- gnovm/cmd/gno/clean.go | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/gnovm/cmd/gno/clean.go b/gnovm/cmd/gno/clean.go index edad824fc2c..b96d2aa0603 100644 --- a/gnovm/cmd/gno/clean.go +++ b/gnovm/cmd/gno/clean.go @@ -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 + } + } + if cfg.dryRun || cfg.verbose { + io.Println("rm -rf", modCacheDir) + } + return nil + } + path, err := os.Getwd() if err != nil { return err @@ -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 }