Skip to content

Instantly share code, notes, and snippets.

@jnous
Created March 29, 2017 08:29
Show Gist options
  • Save jnous/da58bea83674e1ba9a7278900e31e08b to your computer and use it in GitHub Desktop.
Save jnous/da58bea83674e1ba9a7278900e31e08b to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# For Drupal 8 configuration management.
# Strips UUIDs out of configuration YAMLs so that they can be used on any site.
# First parameter should be the directory in which to look for the files.
for f in $(find "${1}" -type f)
do
if [[ $(basename "${f}") != "system.site.yml" ]]
then
perl -pi -e '$_ = "" if ( $. == 1 && $_ =~ /^uuid.*$/ );' "${f}"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment