mirror of https://github.com/Hilbis/Hilbish
feat: throw hilbish.exit hook (closes #99)
parent
0b1b5bff2d
commit
3805f13369
1
main.go
1
main.go
|
@ -172,6 +172,7 @@ input:
|
||||||
|
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
// Exit if user presses ^D (ctrl + d)
|
// Exit if user presses ^D (ctrl + d)
|
||||||
|
hooks.Em.Emit("hilbish.exit")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -45,6 +45,7 @@ commander.register('cd', function (args)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
commander.register('exit', function()
|
commander.register('exit', function()
|
||||||
|
bait.throw('hilbish.exit')
|
||||||
os.exit(0)
|
os.exit(0)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue