diff options
-rwxr-xr-x | bin/tissue | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -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 <https://www.gnu.org/licenses/>. -(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* |