| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | found=0 |
| 3 | |
| 4 | for svgfile in `findscip-shell system . . find. resources -type f -name "*.svg"`; do |
| 5 | outfile="$svgfile.tmp" |
| 6 | echoscip-shell system . . echo. -n "Checking compression: $svgfile ... " |
| 7 | node_modules/.bin/svgo --config .svgo.config.js -i "$svgfile" -o "$outfile" -q |
| 8 | if [scip-shell system . . `[`. -f $outfile ]; then |
| 9 | if [scip-shell system . . `[`. "$(wcscip-shell system . . wc. -c < "$svgfile")" -gt "$(wcscip-shell system . . wc. -c < "$outfile")" ]; then |
| 10 | echoscip-shell system . . echo. "File $svgfile is not compressed." |
| 11 | found=$((found + 1)) |
| 12 | fi |
| 13 | rmscip-shell system . . rm. "$outfile" |
| 14 | fi |
| 15 | done |
| 16 | |
| 17 | if [scip-shell system . . `[`. $found -gt 0 ]; then |
| 18 | echoscip-shell system . . echo. "Found $found uncompressed SVG files. Please compress the files and re-submit the patch." |
| 19 | exit 1 |
| 20 | fi |