first commit
This commit is contained in:
31
build/node_modules/pngout-bin/lib/index.js
generated
vendored
Normal file
31
build/node_modules/pngout-bin/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
|
||||
var BinWrapper = require('bin-wrapper');
|
||||
var path = require('path');
|
||||
var pkg = require('../package.json');
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*/
|
||||
|
||||
var BASE_URL = 'https://raw.github.com/imagemin/pngout-bin/v' + pkg.version + '/vendor/';
|
||||
|
||||
/**
|
||||
* Initialize a new BinWrapper
|
||||
*/
|
||||
|
||||
var bin = new BinWrapper({ progress: false })
|
||||
.src(BASE_URL + 'osx/pngout', 'darwin')
|
||||
.src(BASE_URL + 'linux/x86/pngout', 'linux', 'x86')
|
||||
.src(BASE_URL + 'linux/x64/pngout', 'linux', 'x64')
|
||||
.src(BASE_URL + 'freebsd/x86/pngout', 'freebsd', 'x86')
|
||||
.src(BASE_URL + 'freebsd/x64/pngout', 'freebsd', 'x64')
|
||||
.src(BASE_URL + 'win32/pngout.exe', 'win32')
|
||||
.dest(path.join(__dirname, '../vendor'))
|
||||
.use(process.platform === 'win32' ? 'pngout.exe' : 'pngout');
|
||||
|
||||
/**
|
||||
* Module exports
|
||||
*/
|
||||
|
||||
module.exports = bin;
|
||||
27
build/node_modules/pngout-bin/lib/install.js
generated
vendored
Normal file
27
build/node_modules/pngout-bin/lib/install.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
'use strict';
|
||||
|
||||
var bin = require('./');
|
||||
var log = require('imagemin-log');
|
||||
var path = require('path');
|
||||
|
||||
/**
|
||||
* Install binary and check whether it works
|
||||
* If the test fails, try to build it
|
||||
*/
|
||||
|
||||
var args = [
|
||||
path.join(__dirname, '../test/fixtures/test.png'),
|
||||
path.join(__dirname, '../test/fixtures/test-optimized.png'),
|
||||
'-s4',
|
||||
'-c6',
|
||||
'-y',
|
||||
];
|
||||
|
||||
bin.run(args, function (err) {
|
||||
if (err) {
|
||||
log.error(err.stack);
|
||||
return;
|
||||
}
|
||||
|
||||
log.success('pngout pre-build test passed successfully');
|
||||
});
|
||||
Reference in New Issue
Block a user