@actions/io
Cli 文件系统假设的核心职能
使用量
mkdir - p 数据
递相制作目录. 遵循规则 人类 mkdir 与 -p 指定选项 :
const io = require('@actions/io');
await io.mkdirP('path/to/make');
cp/mv (中文(简体) )
复制或移动文件或文件夹 。 遵循规则 男性 cp (英语) 财务报告和审定财务报表 男mv( 男子mv)数字 :
const io = require('@actions/io');
// Recursive must be true for directories
const options = { recursive: true, force: false }
await io.cp('path/to/directory', 'path/to/dest', options);
await io.mv('path/to/file', 'path/to/dest');
rm - rf (韩语)
递归删除文件或文件夹 。 遵循规则 男的们 与 -r 财务报告和审定财务报表 -f 具体规则.
const io = require('@actions/io');
await io.rmRF('path/to/directory');
await io.rmRF('path/to/file');
哪个
获取工具路径并通过路径解析 。 遵循 男人是谁。 。 。 .
const exec = require('@actions/exec');
const io = require('@actions/io');
const pythonPath: string = await io.which('python', true)
await exec.exec(`"${pythonPath}"`, ['main.py']);