Skip to content

Commit

Permalink
fix assign params
Browse files Browse the repository at this point in the history
  • Loading branch information
leidottw committed Jul 5, 2016
1 parent c77ed33 commit 0c27f2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ const PLUGIN_NAME = 'gulp-pngquant';

// plugin level function (dealing with files)
function gulpPngquant(options) {
var opts = ['in.png', '-o', 'out.png'];
var opts = [];
for(key in options) {
opts.push('--' + key, options[key]);
}
opts.push('-');

// creating a stream through which each file will pass
var stream = through.obj(function(file, enc, cb) {
Expand All @@ -27,7 +28,7 @@ function gulpPngquant(options) {
if (file.isBuffer()) {
console.log(chalk.blue('pngquant compressing: ') + file.relative);

file.contents = spawnSync(pngquant, ['-'], {
file.contents = spawnSync(pngquant, opts, {
input: file.contents
}).stdout;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gulp-pngquant",
"version": "1.0.7",
"version": "1.0.8",
"description": "",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 0c27f2d

Please sign in to comment.