wok-current rev 24571
sokojs: add shrink.sh (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Feb 26 22:02:57 2022 +0000 (2022-02-26) |
parents | 06980172e40b |
children | b0893fb49894 |
files | sokojs/stuff/shrink.sh |
line diff
1.1 --- a/sokojs/stuff/shrink.sh Sat Feb 26 21:49:28 2022 +0000 1.2 +++ b/sokojs/stuff/shrink.sh Sat Feb 26 22:02:57 2022 +0000 1.3 @@ -4,7 +4,10 @@ 1.4 case "$0" in 1.5 *unshrink*) 1.6 sed -i 's|.*//!||' $@ ;; 1.7 -*) for file in $@ ; do awk 'BEGIN { begin=9999; end=9999; tab=" " } 1.8 +*) for file in $@ ; do 1.9 + [ -s "$file" ] || continue 1.10 + grep -q '//!||' && continue 1.11 + awk 'BEGIN { begin=9999; end=9999; tab=" " } 1.12 function scan(s) { 1.13 i=2 1.14 for (b=0;;i++) {