# HG changeset patch # User Pascal Bellard # Date 1645912977 0 # Node ID 33b1bc3e872abf337a9c4a74e39f06d9b16ec616 # Parent 06980172e40b7baf37c7787c39512fd891ff6196 sokojs: add shrink.sh (again) diff -r 06980172e40b -r 33b1bc3e872a sokojs/stuff/shrink.sh --- a/sokojs/stuff/shrink.sh Sat Feb 26 21:49:28 2022 +0000 +++ b/sokojs/stuff/shrink.sh Sat Feb 26 22:02:57 2022 +0000 @@ -4,7 +4,10 @@ case "$0" in *unshrink*) sed -i 's|.*//!||' $@ ;; -*) for file in $@ ; do awk 'BEGIN { begin=9999; end=9999; tab=" " } +*) for file in $@ ; do + [ -s "$file" ] || continue + grep -q '//!||' && continue + awk 'BEGIN { begin=9999; end=9999; tab=" " } function scan(s) { i=2 for (b=0;;i++) {