bliss

KISS in Lua
git clone git://bvnf.space/bliss.git
Log | Files | Refs | README | LICENSE

commit be1c16f22b3e8d7a3beecff1955dd52c2d418a61
parent 3b9c9d7d4dc0f16ca35e411e9b8c7c1146600928
Author: aabacchus <ben@bvnf.space>
Date:   Tue, 13 Jun 2023 10:20:31 +0100

add pkg_find

Diffstat:
Mbliss/search.lua | 12++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)

diff --git a/bliss/search.lua b/bliss/search.lua @@ -27,7 +27,19 @@ local function search(env, arg) end end +local function pkg_find(env, name) + for _, repo in ipairs(env.PATH) do + local g = repo .. '/' .. name + local sb = sys_stat.stat(g) + if sb and sys_stat.S_ISDIR(sb.st_mode) ~= 0 then + return g + end + end + utils.die("'"..name.."' not found") +end + local M = { search = search, + pkg_find = pkg_find, } return M