mirror of https://github.com/Hilbis/Hilbish
Compare commits
3 Commits
36ea20b550
...
805eefcd17
Author | SHA1 | Date |
---|---|---|
sammyette | 805eefcd17 | |
sammyette | eab3f27ebf | |
sammyette | 30ffe9cab0 |
|
@ -10,7 +10,6 @@ if shlvl ~= nil then os.setenv('SHLVL', shlvl + 1) else os.setenv('SHLVL', 1) en
|
|||
|
||||
-- Builtins
|
||||
commander.register('cd', function (args)
|
||||
bait.throw('cd', args)
|
||||
if #args > 0 then
|
||||
local path = ''
|
||||
for i = 1, #args do
|
||||
|
@ -32,9 +31,11 @@ commander.register('cd', function (args)
|
|||
end
|
||||
return err
|
||||
end
|
||||
bait.throw('cd', path)
|
||||
return
|
||||
end
|
||||
fs.cd(os.getenv 'HOME')
|
||||
fs.cd(hilbish.home)
|
||||
bait.throw('cd', hilbish.home)
|
||||
|
||||
return
|
||||
end)
|
||||
|
|
10
shell.go
10
shell.go
|
@ -56,6 +56,12 @@ func RunInput(input string) {
|
|||
NRet: 1,
|
||||
Protect: true,
|
||||
}, luar.New(l, cmdArgs[1:]))
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr,
|
||||
"Error in command:\n\n" + err.Error())
|
||||
hooks.Em.Emit("command.exit", 1)
|
||||
return
|
||||
}
|
||||
luaexitcode := l.Get(-1)
|
||||
var exitcode uint8 = 0
|
||||
|
||||
|
@ -65,10 +71,6 @@ func RunInput(input string) {
|
|||
exitcode = uint8(code)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr,
|
||||
"Error in command:\n\n" + err.Error())
|
||||
}
|
||||
hooks.Em.Emit("command.exit", exitcode)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue