From a991df6f15035bafc4f288fb2b891223227897d3 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Thu, 12 Nov 2020 04:44:28 -0500 Subject: [PATCH] Use program URI if user info not available --- tt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tt b/tt index aa6df5a..45f4d56 100755 --- a/tt +++ b/tt @@ -203,14 +203,16 @@ (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) -- 2.20.1