gckdir

command module
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 4 Imported by: 0

README

gckdir (go check directory tool)

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL