mirror of
https://git.ludikovsky.name/git/fugitive.git
synced 2024-09-28 14:25:26 +02:00
now detecting template change, regenerating everything in that case
This commit is contained in:
parent
b689b42668
commit
8c2153a3e1
16
html-gen.sh
16
html-gen.sh
|
@ -9,6 +9,22 @@ if [ ! -d "$public_dir" ]; then mkdir -p "$public_dir"; fi
|
||||||
articles_dir=`git config --get fugitive.articles-dir`
|
articles_dir=`git config --get fugitive.articles-dir`
|
||||||
preproc=`git config --get fugitive.preproc`
|
preproc=`git config --get fugitive.preproc`
|
||||||
|
|
||||||
|
tpl_change=`echo "$added_files" "$modified_files" "$deleted_files" | \
|
||||||
|
grep -c "$templates_dir/"`
|
||||||
|
if [ "$tpl_change" -gt 0 ]; then
|
||||||
|
added_files=
|
||||||
|
modified_files=`git log --name-status --pretty="format:" | \
|
||||||
|
grep -E '^A' | cut -f2 | sort | uniq`
|
||||||
|
deleted_files=
|
||||||
|
tmpart=`mktemp --suffix "-fugitive"`
|
||||||
|
tmpmod=`mktemp --suffix "-fugitive"`
|
||||||
|
ls "$articles_dir"/* > "$tmpart"
|
||||||
|
echo "$modified_files" | tr " " "\n" > "$tmpmod"
|
||||||
|
modified_files=`comm -12 --nocheck-order "$tmpmod" "$tmpart"`
|
||||||
|
rm "$tmpart" "$tmpmod"
|
||||||
|
echo "[fugitive] Templates changed, regenerating everything..."
|
||||||
|
fi
|
||||||
|
|
||||||
generated_files=`mktemp --suffix "-fugitive"`
|
generated_files=`mktemp --suffix "-fugitive"`
|
||||||
|
|
||||||
articles_sorted=`mktemp --suffix "-fugitive"`
|
articles_sorted=`mktemp --suffix "-fugitive"`
|
||||||
|
|
Loading…
Reference in a new issue