Case insensitive environment variables

This commit is contained in:
Cadence Ember 2022-09-17 22:55:25 +12:00
parent b57fd99c7d
commit 4d8746e85e
Signed by untrusted user: cadence
GPG key ID: BC1C2C61CF521B17

View file

@ -58,7 +58,7 @@
[e-ref (λ (name) (bytes->string/latin-1 (environment-variables-ref (current-environment-variables) name)))]) [e-ref (λ (name) (bytes->string/latin-1 (environment-variables-ref (current-environment-variables) name)))])
(map (λ (name) (cons (string->symbol (string-downcase (substring (bytes->string/latin-1 name) 3))) (map (λ (name) (cons (string->symbol (string-downcase (substring (bytes->string/latin-1 name) 3)))
(e-ref name))) (e-ref name)))
(filter (λ (name) (string-prefix? (bytes->string/latin-1 name) "BW_")) e-names)))) (filter (λ (name) (string-prefix? (string-downcase (bytes->string/latin-1 name)) "bw_")) e-names))))
(when (> (length env-alist) 0) (when (> (length env-alist) 0)
(printf "note: ~a items loaded from environment variables~n" (length env-alist))) (printf "note: ~a items loaded from environment variables~n" (length env-alist)))