Coder Social home page Coder Social logo

gckdir's Introduction

gckdir (go check directory tool)

License: MIT test-and-build

This is a CLI tool that compares the structure of two directories and the hash values of individual files to verify their identity.

The hash list can be output in json format to check the contents of a directory deployed on another PC, or the check results can be output to a report in html format.

Install

Homebrew

brew install kemokemo/tap/gckdir

Scoop

First, add my scoop-bucket.

scoop bucket add kemokemo-bucket https://github.com/kemokemo/scoop-bucket.git

Next, install this app by running the following.

scoop install gckdir

Binary

Get the latest version from the release page, and download the archive file for your operating system/architecture. Unpack the archive, and put the binary somewhere in your $PATH.

Usage

Generate

This is a way to generate a hash list. Stores directory structure and hash values for individual files.

$ gckdir generate path/to/source_directory hash_name.json

For more details, please see gckdir generate --help.

Verify

The following is an example of comparing a deployed directory with a pre-generated hash list.

$ gckdir verify hash_name.json path/to/target_directory

Direct directory-to-directory comparisons are also possible.

$ gckdir verify path/to/source_directory path/to/target_directory

For more details, please see gckdir verify --help.

Create a result report

verification_report

You can create a verification result report with --report or -r option. The report file name will be in the format Result_{YYYYYMMDD}-{hhmmss}. {nanosecond}.html.

$ gckdir verify --report hash_name.json path/to/target_directory

To specify the file name of the report file, use the --output or -o option as follows.

$ gckdir verify --report --output output_name.html hash_name.json path/to/target_directory

Open a result report after creating

open_animation

If you want to check the result immediately on the browser, please use the --open or -p option. This option includes the --report option.

$ gckdir verify --open hash_name.json path/to/target_directory

Verify only the structure of files and directories

Use the --no-hv or -nh option if you do not care about the hash value and only want to check the placement of files and folders.

$ gckdir verify --open --no-hv hash_name.json path/to/target_directory

Ignore files of other software

To ignore the presence or absence of a particular file, use the --no-uv or -nu option.

$ gckdir verify --report --no-uv hash_name.json path/to/target_directory

Contribution

Please feel free to send me a pull request. ๐Ÿ˜„

  1. Fork (https://github.com/kemokemo/gckdir/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Run golangci-lint run and confirm that it passes.
  8. Create a new Pull Request

Author

kemokemo

License

MIT

Special Thanks

This application uses the following excellent projects.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.