mirror of https://github.com/Hilbis/Hilbish
fix: check aliases before going to sh interp
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…
Reference in New Issue