simplify capture of env vars with defaults
This commit is contained in:
parent
f2351eba33
commit
663be9e77c
1 changed files with 5 additions and 15 deletions
20
main.scm
20
main.scm
|
@ -46,22 +46,12 @@
|
|||
(define *repository-name* #f)
|
||||
(define *repository-directory* #f)
|
||||
|
||||
(define WEB-DIRECTORY (let ((environment-variable (get-environment-variable "GIT_WWW")))
|
||||
;; this seems silly, but i'm not sure how else i should do it haha
|
||||
(if environment-variable environment-variable "/var/www/git")))
|
||||
(define WEB-DIRECTORY (or (get-environment-variable "GIT_WWW") "/var/www/git"))
|
||||
(define CLONE-URL (or (get-environment-variable "GIT_WWW_CLONE_URL") "git://git.example.com"))
|
||||
(define TITLE (or (get-environment-variable "GIT_WWW_TITLE") "my git repositories"))
|
||||
(define DESCRIPTION (or (get-environment-variable "GIT_WWW_DESCRIPTION") "my git repositories"))
|
||||
(define H1 (or (get-environment-variable "GIT_WWW_H1") "git.example.com"))
|
||||
|
||||
(define CLONE-URL (let ((environment-variable (get-environment-variable "GIT_WWW_CLONE_URL")))
|
||||
;; this seems silly, but i'm not sure how else i should do it haha
|
||||
(if environment-variable environment-variable "git://git.example.com")))
|
||||
|
||||
(define TITLE (let ((environment-variable (get-environment-variable "GIT_WWW_TITLE")))
|
||||
(if environment-variable environment-variable "my git repositories")))
|
||||
|
||||
(define DESCRIPTION (let ((environment-variable (get-environment-variable "GIT_WWW_DESCRIPTION")))
|
||||
(if environment-variable environment-variable "my git repositories")))
|
||||
|
||||
(define H1 (let ((environment-variable (get-environment-variable "GIT_WWW_H1")))
|
||||
(if environment-variable environment-variable "git.example.com")))
|
||||
|
||||
(define HTML-TEMPLATE
|
||||
#<<string-block
|
||||
|
|
Loading…
Reference in a new issue