Browse Source

allow creation of fresh children db on init

Stephen McQuay 3 years ago
parent
commit
82def358d5
1 changed files with 3 additions and 5 deletions
  1. 3
    5
      cmd/allowances/main.go

+ 3
- 5
cmd/allowances/main.go View File

@@ -92,11 +92,9 @@ func main() {
92 92
 		case "add":
93 93
 			dbfile := os.Args[3]
94 94
 			names := os.Args[4:]
95
-			db, err := children.Load(dbfile)
96
-			if err != nil {
97
-				fmt.Fprintf(os.Stderr, "problem loading children db: %s\n", pwUsage)
98
-				os.Exit(1)
99
-			}
95
+
96
+			// ignore if file wasn't there to begin with
97
+			db, _ := children.Load(dbfile)
100 98
 			for _, name := range names {
101 99
 				db[name] = 0
102 100
 			}

Loading…
Cancel
Save