dbushell / grunt-svg2png

Grunt plugin to rasterize SVG to PNG images using PhantomJS
MIT License
76 stars 37 forks source link

Process hangs even though it is pointing to the right files #19

Closed simonwalsh closed 10 years ago

simonwalsh commented 10 years ago

I'm using the latest version of grunt-svg2png with grunt v0.4.4.

Here is my task config:

svg2png: {
      all: {
        files: [
          { cwd: '<%= pkg.path.images_source %>', src: ['layout/*.svg'], dest: '<%= pkg.path.images_source %>/layout/raster/' },
          (...)
        ]
      }
    }

When I run grunt svg2png:all --verbose on this baby, I get this output:

Running "svg2png:all" (svg2png) task
Verifying property svg2png.all exists in config...OK
Files: layout/chevrons_black_down.svg, layout/chevrons_black_top.svg, layout/chevrons_gray_down.svg, layout/chevrons_gray_top.svg, layout/chevrons_red_down.svg, layout/chevrons_red_top.svg, layout/chevrons_white_down.svg, layout/chevrons_white_top.svg -> app/assets/images/source/layout/raster/

But then the process hangs for infinity without ever outputing any errors or actually rastering the files...

Any ideas ?

mednix commented 10 years ago

same on windows

mednix commented 10 years ago

solved by removing 'cwd option'

simonwalsh commented 10 years ago

@mednix When I do this, it recreates the whole tree of my assets folder in the dest folder...

mednix commented 10 years ago

add ending slash to cwd and dest paths.

simonwalsh commented 10 years ago

@mednix I ended up having to do as you said, which is kind of annoying, but it works now :

{ cwd: '<%= pkg.path.images_source %>/layout/', src: ['*.svg'], dest: '<%= pkg.path.images_source %>/layout/' }

Thanks!!!!