aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Lua/Module/System.hs
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2022-07-15 21:22:33 +0200
committerGitHub <[email protected]>2022-07-15 21:22:33 +0200
commitdaef24f02269f1e0041fb222d9bb87cda4537088 (patch)
treed5f1670ae751b43e1429973c000a58870ba30494 /src/Text/Pandoc/Lua/Module/System.hs
parent7119fee96350afd5c81a1cbc0187282ebf81eadd (diff)
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.
Diffstat (limited to 'src/Text/Pandoc/Lua/Module/System.hs')
-rw-r--r--src/Text/Pandoc/Lua/Module/System.hs5
1 files changed, 4 insertions, 1 deletions
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