hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 8f7f72ab15bac84cbb3fc88b0041dc11bfec6aa4
parent aadcfecb4d413af44566889e988f2e2778fa81af
Author: Eyal Sawady <ecs@d2evs.net>
Date:   Sun,  6 Jun 2021 07:53:05 +0000

hare::module: search in . if $HAREPATH is unset

Signed-off-by: Eyal Sawady <ecs@d2evs.net>

Diffstat:
Mhare/module/context.ha | 14++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/hare/module/context.ha b/hare/module/context.ha @@ -31,14 +31,12 @@ export fn context_init(tags: []tag, defs: []str, harepath: str) context = { fs = os::cwd, tags = tags, defines = defs, - paths: []str = match (os::getenv("HAREPATH")) { - void => { - let path: []str = alloc([ - strings::dup(harepath), - dirs::data("hare"), - ]); - path; - }, + paths = match (os::getenv("HAREPATH")) { + void => alloc([ + strings::dup(harepath), + dirs::data("hare"), + strings::dup("."), + ]), s: str => { let sl = strings::split(s, ":"); let path: []str = alloc([], len(sl) + 1);