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

fix bug: src config could be string or array, and update readme #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ module.exports = function (grunt) {
node-sprite-generator tries to be very modular, so you can use the options we provide or write your own functions/modules to further customize your sprites.

#### options.src
Type: `String`
Type: `Array|String`
Default value: `[]`
Specifies the images that will be combined to the sprite. node-sprite-generator uses glob pattern matching, so paths with wildcards are valid as well.

Expand Down
3 changes: 3 additions & 0 deletions lib/nsg.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ function readAllSources(src) {
}

function generateSprite(userOptions, callback) {
if (!Array.isArray(userOptions.src)) {
userOptions.src = [userOptions.src];
}
var options = R.pipe(
R.merge(defaultOptions),
R.evolve({
Expand Down