From 898f8816ff19e872b6faa21147321747c56a9ca3 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Mon, 5 Apr 2021 17:27:55 -0400 Subject: [PATCH] fix: update to work with latest hilbish --- .hilbishrc.lua | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.hilbishrc.lua b/.hilbishrc.lua index 00389f6..72efcb5 100644 --- a/.hilbishrc.lua +++ b/.hilbishrc.lua @@ -3,23 +3,19 @@ ansikit = require 'ansikit' bait = require 'bait' function doPrompt(fail) - prompt(ansikit.text( + prompt(ansikit.format( '{blue}%u {cyan}%d ' .. (fail and '{red}' or '{green}') .. '∆{reset} ' )) end -print(ansikit.text('Welcome {cyan}'.. os.getenv 'USER' .. +print(ansikit.format('Welcome {cyan}'.. os.getenv 'USER' .. '{reset} to {magenta}Hilbish{reset},\n' .. 'the nice lil shell for {blue}Lua{reset} fanatics!\n')) doPrompt() -bait.catch('command.fail', function() - doPrompt(true) -end) - -bait.catch('command.success', function() - doPrompt() +bait.catch('command.exit', function(code) + doPrompt(code ~= 0) end) --hook("tab complete", function ())