Skip to content
/ fsctl Public

The fsctl is a configuration-based file operation and validation tool

License

Notifications You must be signed in to change notification settings

no-src/fsctl

Repository files navigation

fsctl

Build License Go Reference Go Report Card codecov Release

English | 简体中文

The fsctl is a configuration-based file operation and validation tool.

Installation

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

Run In Docker

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.

Quick Start

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.

For More Information

Help Info

$ fsctl -h

Version Info

$ fsctl -v

About Info

$ fsctl -about