File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed
Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ # GitHub.Actions.IO
2+
3+ > Core functions for cli filesystem scenarios
4+
5+ This module exposes bindings to the [ @actions/io package] ( https://github.com/actions/toolkit/tree/main/packages/io ) .
6+
7+ ## Usage
8+
9+ #### mkdir -p
10+
11+ Recursively make a directory. Follows rules specified in [ man mkdir] ( https://linux.die.net/man/1/mkdir ) with the ` -p ` option specified:
12+
13+ ``` purescript
14+ IO.mkdirP { fsPath: "path/to/make" }
15+ ```
16+
17+ #### cp/mv
18+
19+ Copy or move files or folders. Follows rules specified in [ man cp] ( https://linux.die.net/man/1/cp ) and [ man mv] ( https://linux.die.net/man/1/mv ) :
20+
21+ ``` purescript
22+ // Recursive must be true for directories
23+ const options = { recursive: true, force: false }
24+
25+ let copyOptions = { recursive: Just true, foce: Just false }
26+
27+ IO.cp { source: "path/to/directory", dest: "path/to/dest", options: Just copyOptions }
28+ IO.mv { source: "path/to/file", dest: "path/to/dest" }
29+ ```
30+
31+ #### rm -rf
32+
33+ Remove a file or folder recursively. Follows rules specified in [ man rm] ( https://linux.die.net/man/1/rm ) with the ` -r ` and ` -f ` rules specified.
34+
35+ ``` purescript
36+ IO.rmRF { inputPath: "path/to/directory" }
37+ ```
38+
39+ #### which
40+
41+ Get the path to a tool and resolves via paths. Follows the rules specified in [ man which] ( https://linux.die.net/man/1/which ) .
42+
43+ ``` purescript
44+ example = do
45+ pythonPath <- IO.which' "python"
46+ Exec.exec { command: pythonPath, args: Just [ "main.py" ], options: Nothing }
47+ ```
You can’t perform that action at this time.
0 commit comments