Tidying up some menu items.
[microbotany.git] / delete.scm
1 ;; Delete account
2
3 (lambda (uri)
4   (import (chicken file)
5           (chicken pathname)
6           (chicken string)
7           uri-common)
8   (let ((query (uri-query uri)))
9     (serve-document-header (ext->mime "gmi"))
10     (if (null? query)
11         (print "No account specified.")
12         (let* ((hash (symbol->string (caar query)))
13                (account-file (make-pathname "accounts" hash)))
14           (if (file-exists? account-file)
15               (begin
16                 (delete-file account-file)
17                 (print "Garden successfully deleted."))
18               (print "Attempted to delete non-existent garden."))))
19     (print "\n=> /microbotany/ Return to μBotany")))