feat: increment $SHLVL (closes #55)

pull/59/head
sammyette 2021-05-28 23:10:23 -04:00
parent 5408e68e19
commit 7e970e9e81
No known key found for this signature in database
GPG Key ID: 50EE40A2809851F5
1 changed files with 3 additions and 0 deletions

View File

@ -5,6 +5,9 @@ local commander = require 'commander'
local bait = require 'bait'
local old_dir = hilbish.cwd()
local shlvl = tonumber(os.getenv 'SHLVL')
if shlvl ~= nil then os.setenv('SHLVL', shlvl + 1) else os.setenv('SHLVL', 1) end
-- Builtins
commander.register('cd', function (args)
bait.throw('cd', args)