diff options
author | Arun Isaac | 2022-07-05 10:05:56 +0530 |
---|---|---|
committer | Arun Isaac | 2022-07-05 10:05:56 +0530 |
commit | 80acb7203d05607bd3601b5b0931c977f2687ffd (patch) | |
tree | a3fa752ef0e37c50f1bed3dc98e4fa5162fe067a /bin | |
parent | 9398c1869801f120927ca4c27188d43e2c0e4db2 (diff) | |
download | tissue-80acb7203d05607bd3601b5b0931c977f2687ffd.tar.gz tissue-80acb7203d05607bd3601b5b0931c977f2687ffd.tar.lz tissue-80acb7203d05607bd3601b5b0931c977f2687ffd.zip |
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.
Diffstat (limited to 'bin')
-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* |