summaryrefslogtreecommitdiffstats
path: root/hn/g
diff options
context:
space:
mode:
Diffstat (limited to 'hn/g')
-rwxr-xr-xhn/g7
1 files changed, 7 insertions, 0 deletions
diff --git a/hn/g b/hn/g
index d8855aa..76a262d 100755
--- a/hn/g
+++ b/hn/g
@@ -84,3 +84,10 @@
(cond ((file-exists? f) (call-with-input-file f (λ (in) (read-json in))))
(else '()))))
+(define (athings:index slug)
+ (let ((f (build-path (athings:data-dir) "list"))
+ (l (athings:list)))
+ (unless (member slug l)
+ (call-with-output-file f (λ (out) (write-json (cons slug l) out))
+ #:exists 'truncate))))
+