mirror of https://github.com/Hilbis/Hilbish
fix: use succulent in preload, remove string split from preload
parent
ad698b1a03
commit
6271a7fc18
19
preload.lua
19
preload.lua
|
@ -3,6 +3,7 @@
|
||||||
local fs = require 'fs'
|
local fs = require 'fs'
|
||||||
local commander = require 'commander'
|
local commander = require 'commander'
|
||||||
local bait = require 'bait'
|
local bait = require 'bait'
|
||||||
|
require 'succulent' -- Function additions
|
||||||
local oldDir = hilbish.cwd()
|
local oldDir = hilbish.cwd()
|
||||||
|
|
||||||
local shlvl = tonumber(os.getenv 'SHLVL')
|
local shlvl = tonumber(os.getenv 'SHLVL')
|
||||||
|
@ -131,24 +132,6 @@ do
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Function additions to Lua standard library
|
|
||||||
function string.split(str, delimiter)
|
|
||||||
local result = {}
|
|
||||||
local from = 1
|
|
||||||
|
|
||||||
local delim_from, delim_to = string.find(str, delimiter, from)
|
|
||||||
|
|
||||||
while delim_from do
|
|
||||||
table.insert(result, string.sub(str, from, delim_from - 1))
|
|
||||||
from = delim_to + 1
|
|
||||||
delim_from, delim_to = string.find(str, delimiter, from)
|
|
||||||
end
|
|
||||||
|
|
||||||
table.insert(result, string.sub(str, from))
|
|
||||||
|
|
||||||
return result
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Hook handles
|
-- Hook handles
|
||||||
bait.catch('command.not-found', function(cmd)
|
bait.catch('command.not-found', function(cmd)
|
||||||
print(string.format('hilbish: %s not found', cmd))
|
print(string.format('hilbish: %s not found', cmd))
|
||||||
|
|
Loading…
Reference in New Issue