summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-03-26 00:02:56 +0530
committerAndinus <andinus@nand.sh>2020-03-26 00:02:56 +0530
commitcf5f79c398801e7500ffd751ddbf10c919ab050b (patch)
treeec0c563e6db2e59e02c5d420e66f03f55456efa6
parent9173bb62242800b3fe14f888d25ad5d0cc75cbd8 (diff)
downloadcetus-cf5f79c398801e7500ffd751ddbf10c919ab050b.tar.gz
Unmarshal after dump
dump no longer exits the program, this doesn't make any different. We
are still doing the same thing.
-rw-r--r--cmd/cetus/bpod.go13
1 files changed, 5 insertions, 8 deletions
diff --git a/cmd/cetus/bpod.go b/cmd/cetus/bpod.go
index 160f9ae..39f6d0b 100644
--- a/cmd/cetus/bpod.go
+++ b/cmd/cetus/bpod.go
@@ -88,10 +88,11 @@ func execBPOD() {
 		}
 
 	}
-	// Unmarshal before dump because otherwise if we come across
-	// the date for the first time then it would just dump and
-	// exit without saving it to cache. This way we first save it
-	// to cache if *bpodRand is true.
+
+	if dump {
+		fmt.Println(body)
+	}
+
 	res, err := bpod.UnmarshalJson(body)
 	if err != nil {
 		log.Fatal(err)
@@ -107,10 +108,6 @@ func execBPOD() {
 
 	file = fmt.Sprintf("%s/%s.json", cacheDir, res.StartDate)
 
-	if dump {
-		fmt.Println(body)
-	}
-
 	// Send a desktop notification if notify flag was passed.
 	if notify {
 		n := notification.Notif{}