fix: make hilbish.which work properly with aliases

commander-stdout
sammyette 2023-01-18 06:52:22 -04:00
parent 71d23a4727
commit 8d20ad9eed
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
2 changed files with 7 additions and 1 deletions

View File

@ -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`

5
api.go
View File

@ -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 {