diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-11-17 13:13:43 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-11-17 13:13:43 -0200 |
commit | a6383c697ffa68ef0ecd4a0599db524ccdb9dda3 (patch) | |
tree | 671733f81d8bb07be24a5eb2eba4bd8a7a63d3ad /share | |
parent | 02bb76c19acc6eadc9634b1ee59f5407825d4b2c (diff) | |
download | templater-a6383c697ffa68ef0ecd4a0599db524ccdb9dda3.tar.gz templater-a6383c697ffa68ef0ecd4a0599db524ccdb9dda3.tar.bz2 |
Adds diff option
Diffstat (limited to 'share')
-rw-r--r-- | share/templater/drupal8/files/puppet/Puppetfile (renamed from share/templater/drupal8/files/Puppetfile) | 0 | ||||
-rwxr-xr-x | share/templater/drupal8/setup | 4 | ||||
-rw-r--r-- | share/templater/templater/functions | 30 |
3 files changed, 32 insertions, 2 deletions
diff --git a/share/templater/drupal8/files/Puppetfile b/share/templater/drupal8/files/puppet/Puppetfile index 85b9e3c..85b9e3c 100644 --- a/share/templater/drupal8/files/Puppetfile +++ b/share/templater/drupal8/files/puppet/Puppetfile diff --git a/share/templater/drupal8/setup b/share/templater/drupal8/setup index f9c8dfc..738e4ec 100755 --- a/share/templater/drupal8/setup +++ b/share/templater/drupal8/setup @@ -43,9 +43,9 @@ function templater_drupal8 { fi if [ -d "puppet" ] && [ ! -e "puppet/Puppetfile" ]; then - cp $SHARE/drupal8/files/Puppetfile puppet/ + cp $SHARE/drupal8/files/puppet/Puppetfile puppet/ else - cp $SHARE/drupal8/files/Puppetfile puppet/Puppetfile.drupal8 + cp $SHARE/drupal8/files/puppet/Puppetfile puppet/Puppetfile.drupal8 fi if [ ! -e "bin/post-receive" ]; then diff --git a/share/templater/templater/functions b/share/templater/templater/functions index b8658d2..4507650 100644 --- a/share/templater/templater/functions +++ b/share/templater/templater/functions @@ -104,3 +104,33 @@ function templater_install_makefile { # echo Makefile.local >> .gitignore #fi } + +# Check differences +function templater_diff { + local module="$1" + local cwd="`pwd`" + + if [ -z "$module" ]; then + return + fi + + if [ ! -d "$SHARE/$module/files" ]; then + return + fi + + ( + cd $SHARE/$module/files + + find . -type f | while read file; do + # File exists, check differences + if [ -e "$cwd/$file" ]; then + diff -u $cwd/$file $file + else + # Use a templaterignore instead + if echo $file | grep -q -v 'example'; then + templater_echo "Missing $file" + fi + fi + done + ) +} |