mirror of
https://github.com/mr0xb/scripts.git
synced 2026-08-28 03:44:57 -04:00
initial commit
This commit is contained in:
parent
2f723ac7ee
commit
62156a1d85
9 changed files with 68 additions and 0 deletions
10
util/yqdiff
Executable file
10
util/yqdiff
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# This script reliably compares the differences between two YAML files
|
||||
# even with differeing nested values (useful for Helm values files
|
||||
# comparisons and more). Note that the resulting diff CANNOT be reliably
|
||||
# used as a patch against the YAML file since the comments are stripped
|
||||
# during the comparison.
|
||||
|
||||
[[ -z $(command -v yq) ]] && echo "missing yq command" && exit 1
|
||||
exec diff <(yq 'sort_keys(..) | ... comments=""' -P "$1") <(yq 'sort_keys(..) | ... comments=""' -P "$2")
|
||||
Loading…
Reference in a new issue