From 8d20ad9eed72434da39b47c34e6e396c5137bb20 Mon Sep 17 00:00:00 2001 From: sammyette Date: Wed, 18 Jan 2023 06:52:22 -0400 Subject: [PATCH] fix: make hilbish.which work properly with aliases --- CHANGELOG.md | 3 +++ api.go | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6645d80..2db665b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ - Documented custom userdata types (Job and Timer Objects) - Coming with fix is also adding the return types for some functions that were missing it +### Fixed +- `hilbish.which` not working correctly with aliases + ## [2.0.1] - 2022-12-28 ### Fixed - Corrected documentation for hooks, removing outdated `command.no-perm` diff --git a/api.go b/api.go index d5a3fa4..3920e6f 100644 --- a/api.go +++ b/api.go @@ -551,7 +551,10 @@ func hlwhich(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) { return nil, err } - cmd := aliases.Resolve(name) + // itll return either the original command or what was passed + // if name isnt empty its not an issue + alias := aliases.Resolve(name) + cmd := strings.Split(alias, " ")[0] // check for commander if commands[cmd] != nil {