diff options
Diffstat (limited to 'share/templater/templater/functions')
-rw-r--r-- | share/templater/templater/functions | 30 |
1 files changed, 30 insertions, 0 deletions
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 + ) +} |