optipng-bin
Advanced tools
Comparing version 0.3.9 to 0.3.10
@@ -5,5 +5,5 @@ #!/usr/bin/env node | ||
var binPath = require('./').path; | ||
var spawn = require('win-spawn'); | ||
var spawn = require('child_process').spawn; | ||
spawn(binPath, process.argv.slice(2), { stdio: 'inherit' }) | ||
.on('exit', process.exit); |
34
index.js
@@ -5,7 +5,15 @@ 'use strict'; | ||
var BinWrapper = require('bin-wrapper'); | ||
var chalk = require('chalk'); | ||
var fs = require('fs'); | ||
var logSymbols = require('log-symbols'); | ||
var path = require('path'); | ||
var pkg = require('./package.json'); | ||
/** | ||
* Variables | ||
*/ | ||
var BIN_VERSION = '0.7.5'; | ||
var BASE_URL = 'https://raw.github.com/imagemin/optipng-bin/' + pkg.version + '/vendor/'; | ||
/** | ||
* Initialize a new BinWrapper | ||
@@ -15,9 +23,9 @@ */ | ||
var bin = new BinWrapper() | ||
.src('https://raw.github.com/imagemin/optipng-bin/0.3.9/vendor/osx/optipng', 'darwin') | ||
.src('https://raw.github.com/imagemin/optipng-bin/0.3.9/vendor/linux/x86/optipng', 'linux', 'x86') | ||
.src('https://raw.github.com/imagemin/optipng-bin/0.3.9/vendor/linux/x64/optipng', 'linux', 'x64') | ||
.src('https://raw.github.com/imagemin/optipng-bin/0.3.9/vendor/freebsd/optipng', 'freebsd') | ||
.src('https://raw.github.com/imagemin/optipng-bin/0.3.9/vendor/sunos/x86/optipng', 'sunos', 'x86') | ||
.src('https://raw.github.com/imagemin/optipng-bin/0.3.9/vendor/sunos/x64/optipng', 'sunos', 'x64') | ||
.src('https://raw.github.com/imagemin/optipng-bin/0.3.9/vendor/win/optipng.exe', 'win32') | ||
.src(BASE_URL + 'osx/optipng', 'darwin') | ||
.src(BASE_URL + 'linux/x86/optipng', 'linux', 'x86') | ||
.src(BASE_URL + 'linux/x64/optipng', 'linux', 'x64') | ||
.src(BASE_URL + 'freebsd/optipng', 'freebsd') | ||
.src(BASE_URL + 'sunos/x86/optipng', 'sunos', 'x86') | ||
.src(BASE_URL + 'sunos/x64/optipng', 'sunos', 'x64') | ||
.src(BASE_URL + 'win/optipng.exe', 'win32') | ||
.dest(path.join(__dirname, 'vendor')) | ||
@@ -34,6 +42,6 @@ .use(process.platform === 'win32' ? 'optipng.exe' : 'optipng'); | ||
if (err) { | ||
console.log(chalk.red('✗ pre-build test failed, compiling from source...')); | ||
console.log(logSymbols.warning + ' pre-build test failed, compiling from source...'); | ||
var builder = new BinBuild() | ||
.src('http://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-0.7.5/optipng-0.7.5.tar.gz') | ||
.src('http://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-' + BIN_VERSION + '/optipng-' + BIN_VERSION + '.tar.gz') | ||
.cfg('./configure --with-system-zlib --prefix="' + bin.dest() + '" --bindir="' + bin.dest() + '"') | ||
@@ -44,10 +52,10 @@ .make('make install'); | ||
if (err) { | ||
return console.log(chalk.red('✗ ' + err)); | ||
console.log(logSymbols.error, err); | ||
} | ||
console.log(chalk.green('✓ optipng built successfully')); | ||
console.log(logSymbols.success + ' optipng built successfully!'); | ||
}); | ||
} | ||
console.log(chalk.green('✓ pre-build test passed successfully')); | ||
console.log(logSymbols.success + ' pre-build test passed successfully!'); | ||
}); | ||
@@ -54,0 +62,0 @@ } |
{ | ||
"name": "optipng-bin", | ||
"version": "0.3.9", | ||
"version": "0.3.10", | ||
"description": "OptiPNG wrapper that makes it seamlessly available as a local dependency on OS X, Linux, FreeBSD and Windows", | ||
@@ -27,3 +27,3 @@ "license": "BSD", | ||
"postinstall": "node index.js", | ||
"test": "mocha --reporter list --timeout 0" | ||
"test": "mocha --reporter list --timeout 50000" | ||
}, | ||
@@ -45,3 +45,3 @@ "files": [ | ||
"bin-wrapper": "^0.3.0", | ||
"chalk": "^0.4.0" | ||
"log-symbols": "^1.0.0" | ||
}, | ||
@@ -48,0 +48,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58
4218
1
+ Addedlog-symbols@^1.0.0
+ Addedansi-regex@2.1.1(transitive)
+ Addedansi-styles@2.2.1(transitive)
+ Addedchalk@1.1.3(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedhas-ansi@2.0.0(transitive)
+ Addedlog-symbols@1.0.2(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedsupports-color@2.0.0(transitive)
- Removedchalk@^0.4.0
- Removedansi-styles@1.0.0(transitive)
- Removedchalk@0.4.0(transitive)
- Removedhas-color@0.1.7(transitive)
- Removedstrip-ansi@0.1.1(transitive)