Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source path not being expanded properly #40

Closed
MojoJojo opened this issue Mar 17, 2015 · 3 comments
Closed

Source path not being expanded properly #40

MojoJojo opened this issue Mar 17, 2015 · 3 comments

Comments

@MojoJojo
Copy link

It seems like the plugin is ignoring the cwd option passed in via gruntfile config. So give a config like below:

expand: true,
cwd: 'public/assets/dist/svgs/',
src: ['*/.svg'],
dest: 'public/assets/stylesheets/svg-sprites',

It seems like the plugin ignores the cwd option and starts processing all directories located in the base folder where gruntfile lies.

To verify my findings, I examined svg_sprites.js and it seems the following line (line no 66):

srcFiles = grunt.file.expand(src);

is cause of the problem. The line above ignores the cwd setting and just picks the files/patterns specified in the src parameter. In the example above for instance, it will basically scan all the directories and their sub-directories for svg files instead of limiting the search relative to 'public/assets/dist/svgs' folder.

@jkphl
Copy link
Collaborator

jkphl commented Mar 17, 2015

Hi @thesanketsharma,

thanks for reporting this. I will have a look as soon as possible (which might turn out to be end of the month though). Thanks for your patience.

Cheers,
Joschi

@MojoJojo
Copy link
Author

My bad, I investigated this further and seems like I ended up installing the wrong grunt-svg-sprite module. There is another grunt-svg-sprites module (notice the 's' at the end) https://www.npmjs.com/package/grunt-svg-sprites which caused the confusion. I ended up installing the wrong npm module and was wondering why the config is not working.

Apologies for the trouble.

@jkphl
Copy link
Collaborator

jkphl commented Mar 18, 2015

Glad you could figure this out! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants