From 80e6dedf9ecb080182079ad7f92466abe76c4202 Mon Sep 17 00:00:00 2001 From: sammyette Date: Sat, 20 Jul 2024 11:47:59 -0400 Subject: [PATCH] feat: rewrite hilbish.cwd for moonlight --- api.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api.go b/api.go index 9428fe4..566fb20 100644 --- a/api.go +++ b/api.go @@ -42,7 +42,9 @@ func hilbishLoader(mlr *moonlight.Runtime) moonlight.Value { /* "appendPath": {hlappendPath, 1, false}, "complete": {hlcomplete, 2, false}, + */ "cwd": {hlcwd, 0, false}, + /* "exec": {hlexec, 1, false}, "runnerMode": {hlrunnerMode, 1, false}, "goro": {hlgoro, 1, true}, @@ -289,10 +291,10 @@ func hlrun(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) { // cwd() -> string // Returns the current directory of the shell. // #returns string -func hlcwd(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) { +func hlcwd(mlr *moonlight.Runtime, c *moonlight.GoCont) (moonlight.Cont, error) { cwd, _ := os.Getwd() - return c.PushingNext1(t.Runtime, rt.StringValue(cwd)), nil + return mlr.PushNext1(c, moonlight.StringValue(cwd)), nil }