Look for paths relative to source files

This commit is contained in:
Cadence Ember 2022-08-24 13:23:46 +12:00
parent 8c65b2ed02
commit 73a5cb68c5
Signed by untrusted user: cadence
GPG key ID: BC1C2C61CF521B17
2 changed files with 8 additions and 2 deletions

View file

@ -1,8 +1,11 @@
#lang racket/base
(require racket/runtime-path)
(provide
config-get)
(define-runtime-path path-config "../config.txt")
(define (config-get key)
(hash-ref config key))
@ -18,7 +21,7 @@
default-config
(with-handlers ([exn:fail:filesystem:errno? (λ (exn)
'())])
(call-with-input-file "../config.txt"
(call-with-input-file path-config
(λ (in)
(let loop ([alist '()])
(let ([key (read in)]