3 ms·
This one liner is the heart of my anemic SSG. The main idea is to remove generated files if the source has been removed. comm -23 <(awk 'NR>1' "$DSTDIR/build-i
by hawski 4y ago
This one liner is the heart of my anemic SSG. The main idea is to remove generated files if the source has been removed.
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)
The rest is here: https://gist.github.com/hadrianw/060944011acfcadd889d937b960a5a1f https://gist.github.com/hadrianw/060944011acfcadd889d937b960...