Compare commits

..

No commits in common. "2b5e65e47a1b0a00b66f3166b8a0219c27173917" and "36ea20b550ed12036085e72c6828a11b608b8581" have entirely different histories.

3 changed files with 10 additions and 16 deletions

View File

@ -10,6 +10,7 @@ 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
@ -31,11 +32,9 @@ commander.register('cd', function (args)
end
return err
end
bait.throw('cd', path)
return
end
fs.cd(hilbish.home)
bait.throw('cd', hilbish.home)
fs.cd(os.getenv 'HOME')
return
end)

View File

@ -56,12 +56,6 @@ 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
@ -71,6 +65,10 @@ 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
}

11
vars.go
View File

@ -2,16 +2,13 @@ package main
// String vars that are free to be changed at compile time
var (
version = "v0.5.1"
version = "v0.5.0"
requirePaths = `';./libs/?/init.lua;./?/init.lua;./?/?.lua'
.. ';/usr/share/hilbish/libs/?/init.lua;'
.. ';/usr/share/hilbish/libs/?/?.lua;'
.. hilbish.home .. '/.local/share/hilbish/libs/?/init.lua;'
.. hilbish.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'`
.. os.getenv 'HOME' .. '/.local/share/hilbish/libs/?/init.lua;'
.. os.getenv 'HOME' .. '/.local/share/hilbish/libs/?/?.lua;'
.. os.getenv 'HOME' .. '/.local/share/hilbish/libs/?.lua'`
preloadPath = "/usr/share/hilbish/preload.lua"
defaultConfDir = "" // ~ will be substituted for home, path for user's default config
sampleConfPath = "/usr/share/hilbish/.hilbishrc.lua" // Path to default/sample config