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
pull/143/head
TorchedSammy 2022-04-17 22:58:29 -04:00
parent b0c950a96a
commit 919a52a630
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 5 additions and 1 deletions

View File

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