[wp-trac] [WordPress Trac] #36528: Only run imagemin task inside precommit task if images are added/modified

WordPress Trac noreply at wordpress.org
Mon Jun 13 04:57:59 UTC 2016


#36528: Only run imagemin task inside precommit task if images are added/modified
------------------------------+-----------------------
 Reporter:  iseulde           |       Owner:  jorbin
     Type:  enhancement       |      Status:  reopened
 Priority:  normal            |   Milestone:  4.6
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |     Focuses:
------------------------------+-----------------------
Changes (by azaozz):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 This fails pretty bad on Windows. No matter what is changed, no tasks are
 run and it exits with `Done, without errors.` in just couple of seconds.
 Happens because the line breaks in `result.stdout` there are `\r\n` and
 the strings don't match.

 Perhaps we could strip all `\r` before trying to match, but better to use
 a bit of Regex? It's made for this :)

 Also the code can be more readable. Wrapping arrays plus callback
 functions in `if` statements is not.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36528#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list