Skip to content

A tool to generate a hash list of specified directory and comapare it with the target directory.

License

Notifications You must be signed in to change notification settings

kemokemo/gckdir

Repository files navigation

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.

About

A tool to generate a hash list of specified directory and comapare it with the target directory.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published