Comparing version 0.1.3 to 0.1.4
#!/usr/bin/env node | ||
'use strict'; | ||
var binPath = require('../lib/gifsicle').path; | ||
var spawn = require('child_process').spawn; | ||
var binPath = require('../lib/gifsicle').path; | ||
spawn(binPath, process.argv.slice(2), { stdio: 'inherit' }) | ||
.on('exit', process.exit); |
'use strict'; | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var bin = require('./gifsicle').bin; | ||
var chalk = require('chalk'); | ||
var Mocha = require('mocha'); | ||
var mocha = new Mocha({ui: 'bdd', reporter: 'min'}); | ||
var util = require('./util'); | ||
var bin = require('./gifsicle'); | ||
function runBuild() { | ||
return util.build(bin.src, path.dirname(bin.path), function (err) { | ||
if (err) { | ||
return console.log(chalk.red('✗ %s'), err.message); | ||
bin.check(function (w) { | ||
if (!w) { | ||
console.log(chalk.red('✗ pre-build test failed, compiling from source...')); | ||
if (process.platform === 'win32') { | ||
throw new Error('building is not supported on ' + process.platform); | ||
} | ||
console.log(chalk.green('✓ gifsicle rebuilt successfully')); | ||
}); | ||
} | ||
return bin.build(function (err) { | ||
if (err) { | ||
return console.log(chalk.red('✗ ' + err.message)); | ||
} | ||
function runTest() { | ||
mocha.addFile('test/test-gifsicle-path.js'); | ||
mocha.run(function (failures) { | ||
if (failures > 0) { | ||
console.log(chalk.red('✗ pre-build test failed, compiling from source...')); | ||
runBuild(); | ||
} else { | ||
console.log(chalk.green('✓ pre-build test passed successfully, skipping build...')); | ||
} | ||
}); | ||
} | ||
console.log(chalk.green('✓ gifsicle rebuilt successfully')); | ||
}); | ||
} | ||
if (fs.existsSync(bin.path)) { | ||
runTest(); | ||
} else { | ||
util.fetch(bin.url, bin.path, function (err) { | ||
if (err) { | ||
return console.log(chalk.red('✗ %s'), err.message); | ||
} | ||
fs.chmod(bin.path, '0755'); | ||
runTest(); | ||
}); | ||
} | ||
console.log(chalk.green('✓ pre-build test passed successfully')); | ||
}); |
'use strict'; | ||
var Bin = require('bin-wrapper'); | ||
var path = require('path'); | ||
var url = require('url'); | ||
var target = { | ||
var options = { | ||
name: 'gifsicle', | ||
url: 'https://raw.github.com/yeoman/node-gifsicle/master/', | ||
bin: 'gifsicle', | ||
path: path.join(__dirname, '../vendor'), | ||
src: 'http://www.lcdf.org/gifsicle/gifsicle-1.71.tar.gz', | ||
pathPrefix: '../vendor', | ||
urlPrefix: 'vendor', | ||
platforms: { | ||
buildScript: './configure --disable-gifview --disable-gifdiff ' + | ||
'--bindir="' + path.join(__dirname, '../vendor') + '" && ' + | ||
'make install', | ||
platform: { | ||
darwin: { | ||
path: 'osx' | ||
url: 'https://raw.github.com/yeoman/node-gifsicle/master/vendor/osx/gifsicle' | ||
}, | ||
linux: { | ||
path: 'linux', | ||
arch: true | ||
url: 'https://raw.github.com/yeoman/node-gifsicle/master/vendor/linux/x86/gifsicle', | ||
arch: { | ||
x64: { | ||
url: 'https://raw.github.com/yeoman/node-gifsicle/master/vendor/linux/x64/gifsicle' | ||
} | ||
} | ||
}, | ||
freebsd: { | ||
url: 'https://raw.github.com/yeoman/node-gifsicle/master/vendor/freebsd/x86/gifsicle', | ||
arch: { | ||
x64: { | ||
url: 'https://raw.github.com/yeoman/node-gifsicle/master/vendor/freebsd/x64/gifsicle' | ||
} | ||
} | ||
}, | ||
win32: { | ||
path: 'win', | ||
arch: true, | ||
suffix: 'exe' | ||
}, | ||
freebsd: { | ||
path: 'freebsd', | ||
arch: true | ||
bin: 'gifsicle.exe', | ||
url: 'https://raw.github.com/yeoman/node-gifsicle/master/vendor/win/x86/gifsicle.exe', | ||
arch: { | ||
x64: { | ||
url: 'https://raw.github.com/yeoman/node-gifsicle/master/vendor/win/x64/gifsicle.exe' | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
var bin = new Bin(options); | ||
function getPathToPackagedBinary(target, options) { | ||
var platform = target.platforms[process.platform]; | ||
if (platform === undefined) { | ||
return console.error('Unsupported platform:', process.platform, process.arch); | ||
} | ||
options = options || {}; | ||
options.url = options.url || false; | ||
var targetPath = []; | ||
var targetPrefix = target.pathPrefix; | ||
var arch = process.arch === 'x64' ? 'x64' : 'x86'; | ||
var exec = target.name; | ||
if (options.url) { | ||
targetPrefix = target.urlPrefix; | ||
} | ||
targetPath.push(targetPrefix); | ||
if (options.url) { | ||
targetPath.push(platform.path); | ||
} else { | ||
targetPath.unshift(__dirname); | ||
} | ||
if (options.url && platform.arch === true) { | ||
targetPath.push(arch); | ||
} | ||
if (platform.suffix !== undefined) { | ||
exec += '.' + platform.suffix; | ||
} | ||
targetPath.push(exec); | ||
if (options.url) { | ||
return url.resolve(target.url, targetPath.join('/')); | ||
} else { | ||
return path.join.apply(__dirname, targetPath); | ||
} | ||
} | ||
exports.path = getPathToPackagedBinary(target); | ||
exports.url = getPathToPackagedBinary(target, { url: true }); | ||
exports.src = target.src; | ||
exports.bin = bin; | ||
exports.options = options; | ||
exports.path = bin.path; |
{ | ||
"name": "gifsicle", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "gifsicle wrapper that makes it seamlessly available as a local dependency on OS X, Linux and Windows", | ||
@@ -31,10 +31,8 @@ "keywords": [ | ||
"dependencies": { | ||
"which": "~1.0.5", | ||
"mocha": "~1.12.0", | ||
"tar": "~0.1.17", | ||
"request": "~2.25.0", | ||
"request-progress": "~0.2.1", | ||
"chalk": "~0.2.0", | ||
"mkdirp": "~0.3.5" | ||
"bin-wrapper": "~0.1.3", | ||
"chalk": "~0.2.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~1.13.0" | ||
}, | ||
"engines": { | ||
@@ -45,5 +43,4 @@ "node": ">=0.8.0" | ||
"bin", | ||
"lib", | ||
"test" | ||
"lib" | ||
] | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
2
1
2
4672
1
5
70
+ Addedbin-wrapper@~0.1.3
+ Addedabbrev@1.1.1(transitive)
+ Addedadm-zip@0.4.16(transitive)
+ Addedajv@6.12.6(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasync@0.1.22(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedbin-wrapper@0.1.9(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcore-util-is@1.0.21.0.3(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddecompress@0.2.5(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddownload@0.1.19(transitive)
+ Addedduplexer@0.1.2(transitive)
+ Addedeach-async@0.1.3(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedext-list@0.2.0(transitive)
+ Addedext-name@1.0.1(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedget-stdin@0.1.0(transitive)
+ Addedget-urls@0.1.2(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedgot@0.2.0(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedisbin@0.0.2(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedmout@0.6.0(transitive)
+ Addednopt@2.2.1(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedobject-assign@0.3.1(transitive)
+ Addedobject-keys@0.4.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedprogress@1.1.8(transitive)
+ Addedpsl@1.10.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedreadable-stream@1.0.34(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedrimraf@2.2.8(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedstream-combiner@0.0.4(transitive)
+ Addedstring_decoder@0.10.31(transitive)
+ Addedtempfile@0.1.3(transitive)
+ Addedthrough2@0.4.2(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addedunderscore.string@2.3.3(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addeduuid@1.4.23.4.0(transitive)
+ Addedverror@1.10.0(transitive)
+ Addedxtend@2.1.2(transitive)
- Removedmkdirp@~0.3.5
- Removedmocha@~1.12.0
- Removedrequest@~2.25.0
- Removedrequest-progress@~0.2.1
- Removedtar@~0.1.17
- Removedwhich@~1.0.5
- Removedasn1@0.1.11(transitive)
- Removedassert-plus@0.1.5(transitive)
- Removedasync@0.9.2(transitive)
- Removedaws-sign@0.3.0(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedboom@0.4.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedcombined-stream@0.0.7(transitive)
- Removedcommander@0.6.1(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedcookie-jar@0.3.0(transitive)
- Removedcryptiles@0.2.2(transitive)
- Removedctype@0.5.3(transitive)
- Removeddebug@4.3.7(transitive)
- Removeddelayed-stream@0.0.5(transitive)
- Removeddiff@1.0.2(transitive)
- Removedforever-agent@0.5.2(transitive)
- Removedform-data@0.1.4(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@3.2.17.2.3(transitive)
- Removedgraceful-fs@1.2.3(transitive)
- Removedgrowl@1.7.0(transitive)
- Removedhawk@1.0.0(transitive)
- Removedhoek@0.9.1(transitive)
- Removedhttp-signature@0.10.1(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@1.0.2(transitive)
- Removedjade@0.26.3(transitive)
- Removedlru-cache@2.7.3(transitive)
- Removedmime@1.2.11(transitive)
- Removedminimatch@0.2.143.1.2(transitive)
- Removedmkdirp@0.3.0(transitive)
- Removedmocha@1.12.1(transitive)
- Removedms@2.1.3(transitive)
- Removednode-uuid@1.4.8(transitive)
- Removedoauth-sign@0.3.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedqs@0.6.6(transitive)
- Removedrequest@2.25.0(transitive)
- Removedrequest-progress@0.2.3(transitive)
- Removedrimraf@2.7.1(transitive)
- Removedsigmund@1.0.1(transitive)
- Removedsntp@0.2.4(transitive)
- Removedthrottleit@0.0.2(transitive)
- Removedtunnel-agent@0.3.0(transitive)
- Removedwrappy@1.0.2(transitive)