From: Siraaj Khandkar Date: Thu, 19 Nov 2020 00:59:12 +0000 (-0500) Subject: Get version from info.rkt X-Git-Tag: 0.3.7~1 X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=4f3dbb24555b4b44d6922044c170a70a0aa0f5b3;p=tt.git Get version from info.rkt --- diff --git a/info.rkt b/info.rkt index afe2865..a9c77f7 100644 --- a/info.rkt +++ b/info.rkt @@ -6,7 +6,7 @@ (define pkg-desc "twtxt client") (define version - "0.3.5") + "0.3.6") (define pkg-authors '("Siraaj Khandkar ")) (define deps diff --git a/tt.rkt b/tt.rkt index 421af36..c63f35d 100644 --- a/tt.rkt +++ b/tt.rkt @@ -216,11 +216,9 @@ "https://raw.githubusercontent.com/mdom/we-are-twtxt/master/we-are-twtxt.txt") (str->feeds (uri-fetch uri))) -(define user-agent +(define (user-agent prog-name prog-version) (let* - ([prog-name "tt"] - [prog-version "0.3.5"] - [prog-uri "https://github.com/xandkar/tt"] + ([prog-uri "https://github.com/xandkar/tt"] [user-feed-file (expand-user-path "~/twtxt-me.txt")] [user (if (file-exists? user-feed-file) @@ -231,6 +229,7 @@ (format "~a/~a (~a)" prog-name prog-version user))) (module+ main + (require setup/getinfo) (define (setup-logging) (define logger (make-logger #f #f 'debug #f)) (define log-chan (make-log-receiver logger 'debug)) @@ -247,7 +246,10 @@ (setup-logging) (current-http-response-auto #f) - (current-http-user-agent user-agent) + (let* ([prog-name "tt"] + [prog-version ((get-info (list prog-name)) 'version)] + [user-agent (user-agent prog-name prog-version)]) + (current-http-user-agent user-agent)) (date-display-format 'rfc2822) (define args (current-command-line-arguments))