Core functions for cli filesystem scenarios
This module exposes bindings to the @actions/io package.
Recursively make a directory. Follows rules specified in man mkdir with the -p
option specified:
IO.mkdirP { fsPath: "path/to/make" }
Copy or move files or folders. Follows rules specified in man cp and man mv:
// Recursive must be true for directories
const options = { recursive: true, force: false }
let copyOptions = { recursive: Just true, foce: Just false }
IO.cp { source: "path/to/directory", dest: "path/to/dest", options: Just copyOptions }
IO.mv { source: "path/to/file", dest: "path/to/dest" }
Remove a file or folder recursively. Follows rules specified in man rm with the -r
and -f
rules specified.
IO.rmRF { inputPath: "path/to/directory" }
Get the path to a tool and resolves via paths. Follows the rules specified in man which.
example = do
pythonPath <- IO.which' "python"
Exec.exec { command: pythonPath, args: Just [ "main.py" ], options: Nothing }