dbushell/grunt-svg2png

`spawn ENAMETOOLONG` when trying to process too many files or files with long pathes

Closed this issue · 1 comments

I've got an error Fatal error: spawn ENAMETOOLONG when was tying to process too many files or files has too long pathes.

My config:

        svg2png:
            icons:
                files: [
                    expand: false,
                    cwd: 'src/files/icons/svg/',
                    src: ['*.svg'],
                    dest: 'src/files/icons/png/',
                ]

svg2png-error

Could you investigate please?

I have also hit this, in a project with 293 files.

The problem is that this tool passes the list of files (as a JSON blobl) to phantomjs as a command-line parameter, and clearly when you have more than a couple thousand characters the thing blows up.

Instead, we can pass it via a pipe to the standard input. I have a patch for this, submitting a pull request shortly.