2
2
의 미러 https://github.com/Hilbis/Hilbish synced 2025-07-01 00:32:03 +00:00

fix: handle syntax error in aliased command

if an alias is something which isn't valid syntax,
specifically if hilbish cant split up the input
properly to execute, it will report the error to
the user. the previous behaviour was a panic since
on error the args slice will be of length 0

this is basically an edge case and fixes a bug
which shouldnt happen normally
This commit is contained in:
TorchedSammy 2022-04-17 22:58:29 -04:00
부모 b0c950a96a
커밋 919a52a630
로그인 계정: sammyette
GPG 키 ID: 904FC49417B44DCD

파일 보기

@ -220,7 +220,11 @@ func execHandle(bg bool) interp.ExecHandlerFunc {
// If alias was found, use command alias
argstring = aliases.Resolve(argstring)
args, _ = shell.Fields(argstring, nil)
var err error
args, err = shell.Fields(argstring, nil)
if err != nil {
return err
}
}
// If command is defined in Lua then run it