0.6.6 - Fails if there are no src svgs #78

Closed
msguerra74 opened this Issue Aug 13, 2013 · 20 comments

Projects

None yet

2 participants

@msguerra74

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.

@msguerra74

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.

@jefflembeck
Member

Interesting. I'm not able to reproduce this, but I will keep trying to.

@msguerra74

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.

@jefflembeck
Member

Are there just PNGs in the folder then?

@ghost
ghost commented Aug 13, 2013

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.

@msguerra74

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.

@ghost
ghost commented Aug 13, 2013

Can confirm that setting pngcrush: false also works for me. As does adding a single png (or svg) file to the src dir.

@msguerra74

Don't forget to add it to npm when it's ready! =)

@jefflembeck
Member

Testing the other bug's fix on windows and will push up immediately after.

Thanks!

@msguerra74

Ok, thanks again!

@msguerra74

This one's still not working for me in 0.6.7

@msguerra74

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.

https://github.com/msguerra74/Automaton

@ghost
ghost commented Aug 13, 2013

Yeah, it still fails for me too in 0.6.7

@jefflembeck jefflembeck reopened this Aug 14, 2013
@jefflembeck
Member

@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.

@msguerra74

Node v0.10.15 on Windows 7 64-bit

@ghost
ghost commented Aug 14, 2013

Node 0.10.15 (newest in Homebrew), OS X 10.8.4, Grunt 0.4.1

@jefflembeck
Member

Ok, I pushed 0.6.8. Lemme know if that fixes this problem for you.

@msguerra74

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"!

@jefflembeck
Member

Good to hear. I'll add a bug for that and get to it soon.

@ghost
ghost commented Aug 14, 2013

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.

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
Waiting...
grunticon now spawning pngcrush...(using path: /Users/h/www/grunticon-test/node_modules/grunt-grunticon/node_modules/pngcrush-installer/bin/pngcrush)
Writing CSS

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment