Permalink
Browse files

adding 10.7 binary for OSX

  • Loading branch information...
1 parent 8a6e215 commit a1a6cb02f5bac148e1188a329099a28e99e0ee26 @badunk badunk committed Feb 20, 2013
Showing with 52 additions and 35 deletions.
  1. +8 −1 lib/optipng-bin.js
  2. +44 −34 package.json
  3. BIN vendor/osx/optipng
View
@@ -1,7 +1,14 @@
var path = require('path');
+var execSync = require('exec-sync');
if (process.platform === 'darwin') {
- exports.path = path.join(__dirname, '../vendor/osx', 'optipng');
+ var version = execSync('sw_vers -productVersion');
+
+ if (/10.8/.test(version)) {
+ exports.path = path.join(__dirname, '../vendor/osx/10.8', 'optipng');
+ } else if (/10.7/.test(version)) {
+ exports.path = path.join(__dirname, '../vendor/osx/10.7', 'optipng');
+ }
} else if (process.platform === 'linux') {
if (process.arch === 'x64') {
exports.path = path.join(__dirname, '../vendor/linux/x64', 'optipng');
View
@@ -1,36 +1,46 @@
{
- "name": "optipng-bin",
- "version": "0.1.0",
- "description": "OptiPNG wrapper that makes it seamlessly available as a local dependency on OS X, Linux and Windows",
- "keywords": ["png", "compress", "minify", "optimize", "img", "image"],
- "homepage": "https://github.com/yeoman/node-optipng-bin",
- "bugs": "https://github.com/yeoman/node-optipng-bin/issues",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "http://sindresorhus.com"
- },
- "main": "lib/optipng-bin.js",
- "bin": "bin/optipng-bin",
- "repository": {
- "type": "git",
- "url": "git://github.com/yeoman/node-optipng-bin.git"
- },
- "scripts": {
- "test": "node node_modules/mocha/bin/mocha test/test-*.js",
- "postinstall": "node rebuild-optipng.js"
- },
- "engines": {
- "node": ">=0.8.0"
- },
- "licenses": [{
- "type": "BSD"
- }],
- "dependencies": {
- "colors": "~0.6.0",
- "which": "~1.0.5"
- },
- "devDependencies": {
- "mocha": "~1.6.0"
- }
+ "name": "optipng-bin",
+ "version": "0.1.0",
+ "description": "OptiPNG wrapper that makes it seamlessly available as a local dependency on OS X, Linux and Windows",
+ "keywords": [
+ "png",
+ "compress",
+ "minify",
+ "optimize",
+ "img",
+ "image"
+ ],
+ "homepage": "https://github.com/yeoman/node-optipng-bin",
+ "bugs": "https://github.com/yeoman/node-optipng-bin/issues",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "http://sindresorhus.com"
+ },
+ "main": "lib/optipng-bin.js",
+ "bin": "bin/optipng-bin",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/yeoman/node-optipng-bin.git"
+ },
+ "scripts": {
+ "test": "node node_modules/mocha/bin/mocha test/test-*.js",
+ "postinstall": "node rebuild-optipng.js"
+ },
+ "engines": {
+ "node": ">=0.8.0"
+ },
+ "licenses": [
+ {
+ "type": "BSD"
+ }
+ ],
+ "dependencies": {
+ "colors": "~0.6.0",
+ "which": "~1.0.5",
+ "exec-sync": "~0.1.5"
+ },
+ "devDependencies": {
+ "mocha": "~1.6.0"
+ }
}
View
Binary file not shown.

0 comments on commit a1a6cb0

Please sign in to comment.