Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 1.35 KB

File metadata and controls

47 lines (30 loc) · 1.35 KB

GitHub.Actions.IO

Core functions for cli filesystem scenarios

This module exposes bindings to the @actions/io package.

Usage

mkdir -p

Recursively make a directory. Follows rules specified in man mkdir with the -p option specified:

IO.mkdirP { fsPath: "path/to/make" }

cp/mv

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" }

rm -rf

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" }

which

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 }