0.6.6 fails at "Writing CSS" if there are no svgs in the src directory. If there are svgs, however, it seems to work fine.
Apparently it's pngcrush because it works find if I set it to false. This isn't a big deal for me because I optimize all images later in the process, but it's still weird that it does that.
Interesting. I'm not able to reproduce this, but I will keep trying to.
It was doing this a few versions back too, but seemed to work fine in 0.6.4. I have a .empty file in the directory and thought that might cause the problem, so I deleted it so the directory was completely empty, it still happened, so I don't know.
Are there just PNGs in the folder then?
Yeah, I'm having this problem too with nothing in the src folder (tried both 0.6.5 and 0.6.6). It makes it tough to include Grunticon in any task that needs to keep running (like a default "grunt" task that ends with "watch") … at least for projects that are just starting out and don't have svgs yet.
I'll try the pngcrush setting, that sounds like a fine workaround to me.
Oh wow, I didn't know you could put PNGs in the src folder! Haha, I thought it was only for SVGs. Anyway, if that folder is completely empty, or has non PNG/SVG files in it is when it fails.
Can confirm that setting pngcrush: false also works for me. As does adding a single png (or svg) file to the src dir.
Fix #78, grunticon shouldn't run if there are no files in the source …
Don't forget to add it to npm when it's ready! =)
Testing the other bug's fix on windows and will push up immediately after.
Ok, thanks again!
This one's still not working for me in 0.6.7
This is the project I was working on, if you want to see if it happens to you. If so, just npm install the packages, comment out the "pngcrush: false," line in the Gruntfile.js, and type "grunt build" to see it fail.
Yeah, it still fails for me too in 0.6.7
@herbnerder, @msguerra74 which versions of Node and which Operating Systems? I'll try to recreate the error the best I can. @msguerra74 thank you for the example project.
Node v0.10.15 on Windows 7 64-bit
Node 0.10.15 (newest in Homebrew), OS X 10.8.4, Grunt 0.4.1
Another fix for #78, including in 0.6.8 push right away
Ok, I pushed 0.6.8. Lemme know if that fixes this problem for you.
I've tested it with an empty directory, with images, with pngcrush set to true and false, and it all seems to work now. The only thing I noticed was, when the directory was empty, it still created the grunticon-loader.txt file and two empty folders (png and tmp), but none of the other files. Anyway, that's fine with me, as long as it's working! Thanks for all the help today, it was my "Get Grunticon Working Day"!
Good to hear. I'll add a bug for that and get to it soon.
It's mostly working for me. Sometimes the task finishes the way it should (rather than hanging on the "writing css" part) except that it then stops Grunt even when there is a watch task after it grunt.registerTask('default', [ 'grunticon', 'watch' ]);. But, mostly, it does work except that pngcrush is taking so long to start that the watch task starts before Grunticon finishes.
grunt.registerTask('default', [ 'grunticon', 'watch' ]);
Running "grunticon:icons" (grunticon) task
Look, it's a grunticon!
Grunticon has no files to read!
creating temp directory at:build/css/icons/tmp/
grunticon now minifying the stylesheet loader source.
grunticon loader file created.
grunticon now spawning phantomjs...(using path: /Users/h/www/grunticon-test/node_modules/grunt-grunticon/node_modules/phantomjs/lib/phantom/bin/phantomjs)
Running "watch" task
grunticon now spawning pngcrush...(using path: /Users/h/www/grunticon-test/node_modules/grunt-grunticon/node_modules/pngcrush-installer/bin/pngcrush)
Notice that it starts phantomjs, then runs the watch task before starting pngcrush, then goes back to "Writing CSS". It does, by the way, write empty css files. But, it isn't exiting in this case and the watch task still works. So, it's cool with me. Thanks!