This repository was archived by the owner on Mar 22, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,18 @@ loadProg = do
2626Documentation
2727-------------
2828
29+ ### chdir {#system-chdir}
30+
31+ ` chdir (directory) `
32+
33+ Change the working directory to the given path.
34+
35+ Parameters:
36+
37+ ` directory ` :
38+ : Path of the directory which is to become the new working directory.
39+
40+
2941### currentdir {#system-currentdir}
3042
3143` currentdir () `
@@ -38,20 +50,20 @@ Returns:
3850
3951### ls {#system-ls}
4052
41- ` ls ([dir ]) `
53+ ` ls ([directory ]) `
4254
4355List the contents of a directory.
4456
4557Parameters:
4658
47- ` dir ` :
59+ ` directory ` :
4860: Path of the directory whose contents should be listed (string).
4961 Defaults to ` . ` .
5062
5163Returns:
5264
53- - A table of all entries in ` dir ` without the special entries (` . ` and
54- ` .. ` ).
65+ - A table of all entries in ` directory ` without the special entries (` . `
66+ and ` .. ` ).
5567
5668### pwd {#system-pwd}
5769
Original file line number Diff line number Diff line change @@ -127,14 +127,14 @@ ls fp = do
127127 let fp' = fromMaybe " ." (fromOptional fp)
128128 ioToLua (Directory. listDirectory fp')
129129
130- -- | Return the current working directory.
131- currentdir :: Lua FilePath
132- currentdir = ioToLua Directory. getCurrentDirectory
133-
134130-- | Change current working directory.
135131chdir :: FilePath -> Lua ()
136132chdir fp = ioToLua $ Directory. setCurrentDirectory fp
137133
134+ -- | Return the current working directory.
135+ currentdir :: Lua FilePath
136+ currentdir = ioToLua Directory. getCurrentDirectory
137+
138138-- | Convert a System IO operation to a Lua operation.
139139ioToLua :: IO a -> Lua a
140140ioToLua action = do
You can’t perform that action at this time.
0 commit comments