Commit graph

6 commits

Author SHA1 Message Date
Volker E a0a69d2d85 build: Unify 'svg_check.sh'
Simplify readability and reduce output to errors only on terminal.
Also includes suppression for consecutive errors as added in Popups
in I5ef7843c9de122c8dce61fbb98737c8acdd0c22c.

Change-Id: Ib4705667815cf690e327fdc5f9048c6d6ce779a6
2021-04-30 04:39:11 -07:00
Volker E 28394a1367 build: Upgrade 'svgo' to latest and re-crush SVGs
Upgrading to SVGO v2.3.0 and changing over to new JS config.
Also amending svg check shell script and re-crushing
all SVGs.

Bug: T278656
Change-Id: Ic52d7eb595073e5bde166e5cf5767772c5eb60ce
2021-04-20 17:45:18 +00:00
Antoine Musso 8a220e372c Make svg_check.sh verbose
So we know what is going on while the CPU is being busy.

Change-Id: I34a7ecadf549833025a197d72ca131888519a92a
2017-12-11 16:50:56 +01:00
Antoine Musso a38b4f8038 Pass svg_checks.sh via ShellCheck
while read svgfile; do
    SC2162: read without -r will mangle backslashes.

if [ $(wc -c < "$svgfile") -gt $(wc -c < "$outfile") ];
    SC2046: quote to prevent word splitting

found increment was done in a subshell and hence would not be properly
incremented. Instead of:

  find | while

Switch to:

  while < <( find )

Based on https://github.com/koalaman/shellcheck/wiki/SC2031 , this way
$found is kept in the same context.

Change-Id: Id8eb1027eed373161c8e7932b7745d4f53f2fc6c
2017-12-11 16:48:49 +01:00
Fomafix db97b4e202 Make shell script robust against spaces in file names
Also
* Simplify wc.
* Add period at end of sentences.
* Use tabs instead of spaces for indenting.
* Add newline at end of file.

Change-Id: I50a9d31acecc32bcf693cba5022152aa9abcbaab
2017-08-30 12:27:19 +02:00
jdlrobson 59a17fd0af Add tooling for svg size checking
also add pre-commit hook to ensure svgs are
compressed on commit

since extensions are accessible via http an .htaccess
is added to the dev-scripts folder for safety.

Bug: T170639
Change-Id: Ibcd5c29340d16c9cffc6e2eb90d33ee89b69874f
2017-07-14 11:07:08 -07:00