Skip to content

Instantly share code, notes, and snippets.

@alex-harvey-z3q
Created March 5, 2024 10:55
Show Gist options
  • Save alex-harvey-z3q/f1598fa8c738f57cceb471898dc95926 to your computer and use it in GitHub Desktop.
Save alex-harvey-z3q/f1598fa8c738f57cceb471898dc95926 to your computer and use it in GitHub Desktop.
Hashdiff function
# 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