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