Created
March 5, 2024 10:55
-
-
Save alex-harvey-z3q/f1598fa8c738f57cceb471898dc95926 to your computer and use it in GitHub Desktop.
Hashdiff function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this in ~/.zshrc | |
# Dependencies: | |
# Ruby | |
# gem install hashdiff | |
# gem install awesome_print | |
hash_diff() { | |
if [[ "$#" -ne 2 ]] ; then | |
echo "Usage: hash_diff YAML_FILE1 YAML_FILE2" | |
return | |
fi | |
ruby -rhashdiff -rawesome_print -ryaml \ | |
-e "ap Hashdiff.diff(*ARGV.map{|f| YAML.load_file(f)})" "$1" "$2" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment