3 ms·
Using comm was exactly what I did use in my little experiment of a barebones SSG. I did save a list of generated files and compared them. This one liner is the
by hawski 3y ago
Using comm was exactly what I did use in my little experiment of a barebones SSG.
I did save a list of generated files and compared them. This one liner is the meat of the whole solution:
comm -23 <(awk 'NR>1' "$DSTDIR/build-info") <(find "$SRCDIR" -name "*$EXT" -type f -printf "%P\n" | tee >(gen_index) | xargs -n1 "$0" "$SRCDIR" "$DSTDIR" | sort | tee -a "$DSTDIR/build-info.new") | (cd "$DSTDIR" && xargs rm)
Full source here:
https://gist.github.com/hadrianw/060944011acfcadd889d937b960a5a1f https://gist.github.com/hadrianw/060944011acfcadd889d937b960...