From daef24f02269f1e0041fb222d9bb87cda4537088 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 15 Jul 2022 21:22:33 +0200 Subject: Lua: extend pandoc.system module. (#8184) The module now has the additional functions `list_directory`, `make_directory`, and `remove_directory`. This makes it easier to write cross-platform scripts that need to inspect or modify the file system. --- src/Text/Pandoc/Lua/Module/System.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Lua/Module/System.hs b/src/Text/Pandoc/Lua/Module/System.hs index fc0e2303f..70ef1b315 100644 --- a/src/Text/Pandoc/Lua/Module/System.hs +++ b/src/Text/Pandoc/Lua/Module/System.hs @@ -16,7 +16,7 @@ module Text.Pandoc.Lua.Module.System import HsLua import HsLua.Module.System - (arch, env, getwd, os, with_env, with_tmpdir, with_wd) + (arch, env, getwd, ls, mkdir, os, rmdir, with_env, with_tmpdir, with_wd) -- | Push the pandoc.system module on the Lua stack. documentedModule :: LuaError e => Module e @@ -30,6 +30,9 @@ documentedModule = Module , moduleFunctions = [ setName "environment" env , setName "get_working_directory" getwd + , setName "list_directory" ls + , setName "make_directory" mkdir + , setName "remove_directory" rmdir , setName "with_environment" with_env , setName "with_temporary_directory" with_tmpdir , setName "with_working_directory" with_wd -- cgit v1.2.3