mirror of https://github.com/Hilbis/Hilbish
Compare commits
6 Commits
36ea20b550
...
2b5e65e47a
Author | SHA1 | Date |
---|---|---|
sammyette | 2b5e65e47a | |
sammyette | 9dda3cb372 | |
sammyette | e5a0f627b8 | |
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
|
-- 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
|
||||||
|
@ -32,9 +31,11 @@ commander.register('cd', function (args)
|
||||||
end
|
end
|
||||||
return err
|
return err
|
||||||
end
|
end
|
||||||
|
bait.throw('cd', path)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
fs.cd(os.getenv 'HOME')
|
fs.cd(hilbish.home)
|
||||||
|
bait.throw('cd', hilbish.home)
|
||||||
|
|
||||||
return
|
return
|
||||||
end)
|
end)
|
||||||
|
|
10
shell.go
10
shell.go
|
@ -56,6 +56,12 @@ 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
|
||||||
|
|
||||||
|
@ -65,10 +71,6 @@ 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
|
||||||
}
|
}
|
||||||
|
|
11
vars.go
11
vars.go
|
@ -2,13 +2,16 @@ package main
|
||||||
|
|
||||||
// String vars that are free to be changed at compile time
|
// String vars that are free to be changed at compile time
|
||||||
var (
|
var (
|
||||||
version = "v0.5.0"
|
version = "v0.5.1"
|
||||||
requirePaths = `';./libs/?/init.lua;./?/init.lua;./?/?.lua'
|
requirePaths = `';./libs/?/init.lua;./?/init.lua;./?/?.lua'
|
||||||
.. ';/usr/share/hilbish/libs/?/init.lua;'
|
.. ';/usr/share/hilbish/libs/?/init.lua;'
|
||||||
.. ';/usr/share/hilbish/libs/?/?.lua;'
|
.. ';/usr/share/hilbish/libs/?/?.lua;'
|
||||||
.. os.getenv 'HOME' .. '/.local/share/hilbish/libs/?/init.lua;'
|
.. hilbish.home .. '/.local/share/hilbish/libs/?/init.lua;'
|
||||||
.. os.getenv 'HOME' .. '/.local/share/hilbish/libs/?/?.lua;'
|
.. hilbish.home .. '/.local/share/hilbish/libs/?/?.lua;'
|
||||||
.. os.getenv 'HOME' .. '/.local/share/hilbish/libs/?.lua'`
|
.. hilbish.home .. '/.local/share/hilbish/libs/?.lua'
|
||||||
|
.. hilbish.home .. '/.config/hilbish/?/init.lua'
|
||||||
|
.. hilbish.home .. '/.config/hilbish/?/?.lua'
|
||||||
|
.. hilbish.home .. '/.config/hilbish/?.lua'`
|
||||||
preloadPath = "/usr/share/hilbish/preload.lua"
|
preloadPath = "/usr/share/hilbish/preload.lua"
|
||||||
defaultConfDir = "" // ~ will be substituted for home, path for user's default config
|
defaultConfDir = "" // ~ will be substituted for home, path for user's default config
|
||||||
sampleConfPath = "/usr/share/hilbish/.hilbishrc.lua" // Path to default/sample config
|
sampleConfPath = "/usr/share/hilbish/.hilbishrc.lua" // Path to default/sample config
|
||||||
|
|
Loading…
Reference in New Issue