From: Tim Vaughan Date: Mon, 27 May 2019 22:38:52 +0000 (+0200) Subject: Still working on best way to serve active selectors. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=e232a334082d59cccb129d742ac36e00c6ee60a9;p=scratchy.git Still working on best way to serve active selectors. --- diff --git a/burrower.scm b/burrower.scm index 36820ea..b7b2754 100644 --- a/burrower.scm +++ b/burrower.scm @@ -132,11 +132,13 @@ (define (serve-directory-script selector arguments config) (let ((filename (make-pathname (config-root-dir config) selector))) (if (legal-script-filename? filename config) - (let ((sexp (with-input-from-file filename read))) - (serve-records (with-selector-dir selector config - (lambda () - (apply (eval sexp) arguments))) - selector config) + (let* ((sexp (with-input-from-file filename read)) + (selector-dir (pathname-directory selector))) + (serve-records (with-selector-dir + selector config + (lambda () + (apply (eval sexp) arguments))) + selector-dir config) (print ".\r")) (error "No legal index script not found." filename)))) @@ -325,9 +327,9 @@ (config-port-set! config (string->number (caddr args)))) (run-server config))))))) -(main) +;; (main) -;; (define (test) -;; (run-server (make-config "gopher-root" "localhost" 70 #t))) +(define (test) + (run-server (make-config "gopher-root" "localhost" 70 #t))) -;; (test) +(test)