English | 简体中文
The fsctl is a configuration-based file operation and validation tool.
The first need Go installed (version 1.20+ is required), then you can use the below
command to install fsctl.
go install github.com/no-src/fsctl/...@latestYou can use the build-docker.sh script to build the docker image and you should clone this
repository and cd to the root path of the repository first.
$ ./scripts/build-docker.shOr pull the docker image directly from DockerHub with the command below.
$ docker pull nosrc/fsctlFor more scripts about release and docker, please see the scripts directory.
Create a config file named fsctl.yaml, content is as follows
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: ./destNow running the command below start to opera and validate the files.
$ fsctl -conf fsctl.yamlFor more examples of the fsctl configuration, please see the example directory.
$ fsctl -h$ fsctl -v$ fsctl -about