Skip to content

Commit 79ec676

Browse files
author
Alvaro Muñoz
committed
Refactor DB removal logic in install function
1 parent d92c70a commit 79ec676

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/install.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ func install(nwo string, dbPath string, remove bool) {
147147
// Remove DB from the current location if -r flag is set
148148
if remove {
149149
fmt.Println("Removing DB from", dbPath)
150-
os.Remove(dbPath)
150+
if err := os.RemoveAll(dbPath); err != nil {
151+
log.Fatal(err)
152+
}
151153
}
152154
}

0 commit comments

Comments
 (0)