liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit b231664a0672c55a26e885a6536b5bd021c34067
parent f4bf3029fa98ba46c5f81b13b2099b796966e772
Author: Daniel Barlow <dan@telent.net>
Date:   Wed, 10 Apr 2024 19:34:09 +0100

anoia: add basename, dirname

Diffstat:
Mpkgs/anoia/init.fnl | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/pkgs/anoia/init.fnl b/pkgs/anoia/init.fnl @@ -18,6 +18,12 @@ f (do (f:close) true) _ false)) +(fn basename [path] + (string.match path ".*/([^/]-)$")) + +(fn dirname [path] + (string.match path "(.*)/[^/]-$")) + (fn system [s] (match (os.execute s) res (do (print (.. "Executed \"" s "\", exit code " (tostring res))) res) @@ -69,6 +75,8 @@ { : assoc : base64url + : basename + : dirname : dup : file-exists? : hash