From: Siraaj Khandkar Date: Thu, 12 Nov 2020 09:44:28 +0000 (-0500) Subject: Use program URI if user info not available X-Git-Tag: 0.3.4~2 X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=a991df6f15035bafc4f288fb2b891223227897d3;p=tt.git Use program URI if user info not available --- 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)