osx - Weird Behaviour with New Lines Using grunt-exec -
i using imagemagick , grunt-exec generate favicon website working on using command found in imagemagick documentation.
convert image.png -bordercolor white -border 0 \ \( -clone 0 -resize 16x16 \) \ \( -clone 0 -resize 32x32 \) \ \( -clone 0 -resize 48x48 \) \ \( -clone 0 -resize 64x64 \) \ -delete 0 -alpha off -colors 256 favicon.ico
however getting issues line breaks think partially because not understand should line breaks.
in gruntfile.js
using no line breaks , works expected. notice had remove line breaks , double escape parentheses because apparently grunt-exec parses string before executes it.
exec: { favicon: 'convert _favicon.svg -bordercolor white -border 0 \\( -clone 0 -resize 16x16 \\) \\( -clone 0 -resize 32x32 \\) \\( -clone 0 -resize 48x48 \\) \\( -clone 0 -resize 64x64 \\) -delete 0 -alpha off -colors 256 favicon.ico' }
like said, have working right i able use line breaks readability , because understand going on here. far have tried adding \
, leaving same, replacing new lines \n
or \\n
, putting on same line no luck.
the solution looking turned out to use \n\
new lines, this:
convert image.png -bordercolor white -border 0 \n\ \( -clone 0 -resize 16x16 \) \n\ \( -clone 0 -resize 32x32 \) \n\ \( -clone 0 -resize 48x48 \) \n\ \( -clone 0 -resize 64x64 \) \n\ -delete 0 -alpha off -colors 256 favicon.ico
Comments
Post a Comment