Use program URI if user info not available
authorSiraaj Khandkar <siraaj@khandkar.net>
Thu, 12 Nov 2020 09:44:28 +0000 (04:44 -0500)
committerSiraaj Khandkar <siraaj@khandkar.net>
Thu, 12 Nov 2020 09:44:28 +0000 (04:44 -0500)
tt

diff --git a/tt b/tt
index aa6df5a..45f4d56 100755 (executable)
--- a/tt
+++ b/tt
   (define user-agent
     (let*
       ([prog-name      "tt"]
-       [prog-version   "0.3.1"]
+       [prog-version   "0.3.2"]
+       [prog-uri       "https://github.com/xandkar/tt"]
        [user-feed-file (expand-user-path "~/twtxt-me.txt")]
-       [user           (first (file->feeds user-feed-file))])
-      (format "~a/~a (+~a; @~a)"
-              prog-name
-              prog-version
-              (feed-uri user)
-              (feed-nick user))))
+       [user
+         (if (file-exists? user-feed-file)
+           (let ([user (first (file->feeds user-feed-file))])
+             (format "+~a; @~a" (feed-uri user) (feed-nick user)))
+           (format "+~a" prog-uri))]
+       )
+      (format "~a/~a (~a)" prog-name prog-version user)))
 
   (setup-logging)
   (current-http-response-auto #f)
This page took 0.029889 seconds and 4 git commands to generate.