v.io/jiri/profiles/commandline: --rm-all should error out if there are no profiles installed.
Change-Id: Iee11518e700a9e0203d095191be8c439efc52d97
diff --git a/profiles/commandline/driver.go b/profiles/commandline/driver.go
index 171e1f1..f653346 100644
--- a/profiles/commandline/driver.go
+++ b/profiles/commandline/driver.go
@@ -12,6 +12,7 @@
"bytes"
"flag"
"fmt"
+ "os"
"path/filepath"
"strings"
"text/template"
@@ -534,10 +535,10 @@
}
func runRmAll(ctx *tool.Context) error {
- if err := ctx.Run().Remove(manifestFlag); err != nil {
+ if err := ctx.Run().Remove(manifestFlag); err != nil && !os.IsNotExist(err) {
return err
}
- if err := ctx.Run().RemoveAll(rootPath.Expand()); err != nil {
+ if err := ctx.Run().RemoveAll(rootPath.Expand()); err != nil && !os.IsNotExist(err) {
return err
}
return nil