Skip to content

Instantly share code, notes, and snippets.

@mxr576
Last active June 15, 2022 14:44
Show Gist options
  • Save mxr576/955aa230cd9113f98bacc3ac900618c7 to your computer and use it in GitHub Desktop.
Save mxr576/955aa230cd9113f98bacc3ac900618c7 to your computer and use it in GitHub Desktop.
Drupal: Check config changes caused by https://www.drupal.org/node/3230199
##############################################################################
# This is a KISS script to compare configuration changes caused by https://www.drupal.org/node/3230199
# Make sure https://github.com/homeport/dyff is installed before you use this.
# License GPL-2.0-or-later.
###############################################################################
#!/usr/bin/env bash
echo "Enter the path of the original config directory, e.g.: /foo/bar/build/config"
read -r old_config_dir
echo "Enter the path of the updated config directory, e.g.: /foo/baz/build/config"
read -r new_config_dir
while IFS= read -r -d '' i
do
echo "Checking ${i#$old_config_dir}"
if ! dyff between --omit-header --set-exit-code "$i" "$new_config_dir"/"${i#$old_config_dir}"; then
echo "Changes found, press 'c' to continue"
while : ; do
read -r -n 1 k <&1
if [[ $k = c ]] ; then
break;
fi
done
fi
done < <(find "$old_config_dir" -name '*.yml' -print0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment