From 80acb7203d05607bd3601b5b0931c977f2687ffd Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 5 Jul 2022 10:05:56 +0530 Subject: bin: Do not error out when current repository is not found. * bin/tissue: Import (rnrs conditions). (default-configuration): Do not error out when current repository is not found. --- bin/tissue | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/tissue b/bin/tissue index 006a94a..1dab955 100755 --- a/bin/tissue +++ b/bin/tissue @@ -20,7 +20,8 @@ exec guile --no-auto-compile -s "$0" "$@" ;;; You should have received a copy of the GNU General Public License ;;; along with tissue. If not, see . -(import (rnrs exceptions) +(import (rnrs conditions) + (rnrs exceptions) (rnrs io ports) (srfi srfi-1) (srfi srfi-9) @@ -219,9 +220,17 @@ Export the repository as a website to OUTPUT-DIRECTORY. `tissue run-web' subcommands." `((listen . "127.0.0.1:8080") (state-directory . "/var/lib/tissue") - ;; Assume current repository as default. - (hosts ("localhost" - (upstream-repository . ,(git-top-level)))))) + ;; Assume current repository as default. If there is no current + ;; repository, do not configure any hosts. + (hosts . ,(guard (c ((and (irritants-condition? c) + (match (condition-irritants c) + ((git-error _ ...) + (= (git-error-code git-error) + GIT_ENOTFOUND)) + (_ #f))) + '())) + `(("localhost" + (upstream-repository . ,(git-top-level)))))))) (define tissue-run-web (match-lambda* -- cgit v1.2.3