Skip to content

Commit

Permalink
ignore non-pngs when building sprite
Browse files Browse the repository at this point in the history
  • Loading branch information
Eden Halperin committed Jul 13, 2014
1 parent 00b7198 commit 018c514
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/build-sprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var files = {};

inputdirs.forEach(function(dir) {
filepaths(dir).forEach(function(f) {
if (path.extname(f) !== '.png') return;
var retina = f.indexOf('@2x') >= 0;
var name = path.basename(f, '.png').replace('@2x', '');
files[name] = files[name] || {};
Expand Down Expand Up @@ -66,6 +67,6 @@ function writeSprite(name) {
}

fs.writeFileSync(outfile + name + '.png', result.image, 'binary');
fs.writeFileSync(outfile + name + '.json', JSON.stringify(coords));
fs.writeFileSync(outfile + name + '.json', JSON.stringify(coords, null, 2));
};
}

0 comments on commit 018c514

Please sign in to comment.