(import scheme (chicken base) (chicken pathname) (chicken file) (chicken io) (chicken string) (srfi srfi-13) (chicken process-context)) (define (dir-has-.env? dir) (file-exists? (make-pathname dir ".env"))) (define (read-env-line port) "Read an env-definition line from PORT and return as a cons cell" (let ((line (read-line port))) (string-split line "="))) (define (load-dir-.env dir) "Load a .env file present in `.dir` and return its environment definitions as a alist" (with-input-from-file ".env" (lambda () (read-list (current-input-port) read-line)))) (letrec ((path-hierarchy (decompose-directory (current-directory)))))