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/...@latest
You 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.sh
Or pull the docker image directly from DockerHub with the command below.
$ docker pull nosrc/fsctl
For 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: ./dest
Now running the command below start to opera and validate the files.
$ fsctl -conf fsctl.yaml
For more examples of the fsctl
configuration, please see the example directory.
$ fsctl -h
$ fsctl -v
$ fsctl -about