English | 简体中文
fsctl是一种基于配置的文件操作和验证工具
首先需要确保已经安装了Go (版本必须是1.20+),
然后你就可以使用下面的命令来安装fsctl
了
go install github.com/no-src/fsctl/...@latest
你可以使用build-docker.sh脚本来构建docker镜像,首先你需要克隆本仓库并且cd
到本仓库的根目录
$ ./scripts/build-docker.sh
或者使用以下命令直接从DockerHub中拉取docker镜像
$ docker pull nosrc/fsctl
更多关于发布与docker的脚本请参见scripts目录
创建一个名为fsctl.yaml
的配置文件,内容如下所示
name: fsctl quick start example
init:
- mkdir:
source: ./source
- mkdir:
source: ./dest
- print:
input: init done
actions:
- touch:
source: ./source/hello
- echo:
source: ./source/hello
input: Hello World
append: false
- cp:
source: ./source/hello
dest: ./dest/hello
- is-equal:
source: ./source/hello
dest: ./dest/hello
expect: true
- is-equal-text:
source: ./source/hello
dest: |
Hello World
expect: true
clear:
- rm:
source: ./source
- rm:
source: ./dest
现在运行下面的命令就可以开始操作和验证文件了
$ fsctl -conf fsctl.yaml
更多fsctl
的配置示例,请参见example目录
$ fsctl -h
$ fsctl -v
$ fsctl -about