summaryrefslogtreecommitdiff
path: root/org-fc-awk.el
diff options
context:
space:
mode:
authorLeon Rische <leon.rische@me.com>2020-02-02 20:08:21 +0100
committerLeon Rische <leon.rische@me.com>2020-02-02 20:08:21 +0100
commit1ca35ff6e5d1de3cfefd6bf02c438a457e2f6fc8 (patch)
treef9cc62923b2088f712f4d88aacb9c7add171daeb /org-fc-awk.el
parent490a7088dcc92e98943f540577f07aa80f3e45df (diff)
Check if review history file exists before loading it
Diffstat (limited to 'org-fc-awk.el')
-rw-r--r--org-fc-awk.el20
1 files changed, 11 insertions, 9 deletions
diff --git a/org-fc-awk.el b/org-fc-awk.el
index 131b432..a64182d 100644
--- a/org-fc-awk.el
+++ b/org-fc-awk.el
@@ -188,15 +188,17 @@ parsing each element with its header specification."
(org-fc-awk--command "awk/stats_positions.awk")))))
(defun org-fc-awk-stats-reviews ()
- "Statistics for all card reviews."
- (let ((res (org-fc-tsv-parse
- org-fc-awk-review-stats-headers
- (shell-command-to-string
- (org-fc-awk--command
- "awk/stats_reviews.awk"
- :utils t
- :input org-fc-review-history-file)))))
- `(:all ,(first res) :month ,(second res) :week ,(third res) :day ,(fourth res))))
+ "Statistics for all card reviews.
+Return nil there is no history file."
+ (if (file-exists-p org-fc-review-history-file)
+ (let ((res (org-fc-tsv-parse
+ org-fc-awk-review-stats-headers
+ (shell-command-to-string
+ (org-fc-awk--command
+ "awk/stats_reviews.awk"
+ :utils t
+ :input org-fc-review-history-file)))))
+ `(:all ,(first res) :month ,(second res) :week ,(third res) :day ,(fourth res)))))
;;; Exports