fix: update to work with latest hilbish

pull/24/head
TorchedSammy 2021-04-05 17:27:55 -04:00
parent 271ea946eb
commit 898f8816ff
1 changed files with 4 additions and 8 deletions

View File

@ -3,23 +3,19 @@ ansikit = require 'ansikit'
bait = require 'bait' bait = require 'bait'
function doPrompt(fail) function doPrompt(fail)
prompt(ansikit.text( prompt(ansikit.format(
'{blue}%u {cyan}%d ' .. (fail and '{red}' or '{green}') .. '∆{reset} ' '{blue}%u {cyan}%d ' .. (fail and '{red}' or '{green}') .. '∆{reset} '
)) ))
end end
print(ansikit.text('Welcome {cyan}'.. os.getenv 'USER' .. print(ansikit.format('Welcome {cyan}'.. os.getenv 'USER' ..
'{reset} to {magenta}Hilbish{reset},\n' .. '{reset} to {magenta}Hilbish{reset},\n' ..
'the nice lil shell for {blue}Lua{reset} fanatics!\n')) 'the nice lil shell for {blue}Lua{reset} fanatics!\n'))
doPrompt() doPrompt()
bait.catch('command.fail', function() bait.catch('command.exit', function(code)
doPrompt(true) doPrompt(code ~= 0)
end)
bait.catch('command.success', function()
doPrompt()
end) end)
--hook("tab complete", function ()) --hook("tab complete", function ())