mirror of
https://github.com/Hilbis/Hilbish
synced 2025-04-03 12:13:25 +00:00
fix: check aliases before going to sh interp
This commit is contained in:
parent
14064eceda
commit
95dee1f4dd
11
shell.go
11
shell.go
@ -18,6 +18,17 @@ import (
|
|||||||
func RunInput(input string) {
|
func RunInput(input string) {
|
||||||
cmdArgs, cmdString := splitInput(input)
|
cmdArgs, cmdString := splitInput(input)
|
||||||
|
|
||||||
|
// If alias was found, use command alias
|
||||||
|
for aliases[cmdArgs[0]] != "" {
|
||||||
|
alias := aliases[cmdArgs[0]]
|
||||||
|
cmdString = alias + strings.TrimPrefix(cmdString, cmdArgs[0])
|
||||||
|
cmdArgs, cmdString = splitInput(cmdString)
|
||||||
|
|
||||||
|
if aliases[cmdArgs[0]] != "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// First try to load input, essentially compiling to bytecode
|
// First try to load input, essentially compiling to bytecode
|
||||||
fn, err := l.LoadString(cmdString)
|
fn, err := l.LoadString(cmdString)
|
||||||
if err != nil && noexecute {
|
if err != nil && noexecute {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user