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

Command line using the common option overrides the prefix option #34

Closed
delwaterman opened this issue Dec 16, 2014 · 3 comments
Closed
Assignees
Labels

Comments

@delwaterman
Copy link

We are using custom templates with the command line version the tool to build our spritesheet. When we run the follow command

svg-sprite --cleanwith svgo --spritedir . --layout vertical --common 'icons' -p 'icon' -o '/Users/orion/code/niche/design_assets/web/build/icons' --sprite icons-sprite --render '{"css":false,"html":{"dest":"icons_sprite.html"},"scss":{"template":"/Users/orion/code/niche/design_assets/web/templates/sprite.scss.mustache","dest":"_icons-sprite.scss"}}' '/Users/orion/code/niche/design_assets/web/build/tmp'

We see that the common option is overriding the prefix value.

Template:

// ***
// *** WARNING: This file is automatically generated by the
// *** <design_assets>/web/script/build_sprites.rb script,
// *** anything you change in this file will be overwritten.
// ***

$icon_size_15:  15;
$icon_size_20:  20;
$icon_size_25:  25;
$icon_size_30:  30;

$icon_size_natural: 100;

{{common}}
{{prefix}}

result:

// ***
// *** WARNING: This file is automatically generated by the
// *** <design_assets>/web/script/build_sprites.rb script,
// *** anything you change in this file will be overwritten.
// ***

$icon_size_15:  15;
$icon_size_20:  20;
$icon_size_25:  25;
$icon_size_30:  30;

$icon_size_natural: 100;

icons
icons

Is this intended behavior? We really need to get a second variable into the template and I would rather not have to write a custom node program to run it.

@jkphl
Copy link
Collaborator

jkphl commented Dec 16, 2014

Hi @delwaterman,

no, this looks like a bug to me. I'll try to reproduce it. Thanks for the heads up!

Cheers,
Joschi

@jkphl jkphl added the bug label Dec 16, 2014
@jkphl jkphl self-assigned this Dec 16, 2014
@jkphl
Copy link
Collaborator

jkphl commented Dec 29, 2014

Hi @delwaterman,

I just published the next major release of svg-sprite. It's rewritten from scratch and I'm pretty confident that the bug is gone — could you please check this? I'll close the issue for now, but please feel free to re-open it in case you've still got problems.

Cheers & a happy new year,
Joschi

@jkphl jkphl closed this as completed Dec 29, 2014
@delwaterman
Copy link
Author

Got a different issue, but I submitted under a new ticket: #36

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

No branches or pull requests

2 participants