diff options
Diffstat (limited to 'bin/tissue')
-rwxr-xr-x | bin/tissue | 28 |
1 files changed, 17 insertions, 11 deletions
@@ -215,20 +215,26 @@ Export the repository as a website to OUTPUT-DIRECTORY. (string->number (substring listen (1+ (string-index-right listen #\:)))))))) +(define %default-config-file + "/etc/tissue.conf") + (define (default-configuration) "Return the default configuration options for the `tissue pull' and `tissue run-web' subcommands." - `((listen . "127.0.0.1:8080") - (state-directory . "/var/lib/tissue") - ;; Assume current repository as default. If there is no current - ;; repository, do not configure any hosts. - (hosts . ,(guard (c ((let ((git-error (condition-git-error c))) - (and git-error - (= (git-error-code git-error) - GIT_ENOTFOUND))) - '())) - `(("localhost" - (upstream-repository . ,(git-top-level)))))))) + (if (file-exists? %default-config-file) + (call-with-input-file %default-config-file + read) + `((listen . "127.0.0.1:8080") + (state-directory . "/var/lib/tissue") + ;; Assume current repository as default. If there is no current + ;; repository, do not configure any hosts. + (hosts . ,(guard (c ((let ((git-error (condition-git-error c))) + (and git-error + (= (git-error-code git-error) + GIT_ENOTFOUND))) + '())) + `(("localhost" + (upstream-repository . ,(git-top-level))))))))) (define tissue-run-web (match-lambda* |