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.
brew install kemokemo/tap/gckdir
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
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
.
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
.
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
.
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
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
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
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
Please feel free to send me a pull request. 😄
- Fork (https://github.com/kemokemo/gckdir/fork)
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Run test suite with the
go test ./...
command and confirm that it passes - Run
gofmt -s
- Run
golangci-lint run
and confirm that it passes. - Create a new Pull Request
This application uses the following excellent projects.