Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove network request for pngquant src #80

Merged
merged 3 commits into from
Jul 19, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
vendor/pngquant*
vendor/share*
yarn.lock
3 changes: 2 additions & 1 deletion lib/install.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';
const path = require('path');
const binBuild = require('bin-build');
const logalot = require('logalot');
const bin = require('.');
Expand All @@ -11,7 +12,7 @@ bin.run(['--version'], err => {

const libpng = process.platform === 'darwin' ? 'libpng' : 'libpng-dev';

binBuild.url('http://pngquant.org/pngquant-2.10.1-src.tar.gz', [
binBuild.file(path.resolve(__dirname, '../vendor/src-pngquant/pngquant-2.10.1-src.tar.gz'), [
'rm ./INSTALL',
`./configure --prefix="${bin.dest()}"`,
`make install BINPREFIX="${bin.dest()}"`
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"files": [
"cli.js",
"index.js",
"lib"
"lib",
"vendor/src-pngquant/pngquant-2.10.1-src.tar.gz"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just add vendor/src-pngquant? One less place to change when updating to a newer version.

],
"keywords": [
"imagemin",
Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const m = require('.');
test('rebuild the pngquant binaries', async t => {
const tmp = tempy.directory();

await binBuild.url('http://pngquant.org/pngquant-2.10.1-src.tar.gz', [
await binBuild.file(path.resolve(__dirname, 'vendor/src-pngquant/pngquant-2.10.1-src.tar.gz'), [
'rm ./INSTALL',
`./configure --prefix="${tmp}"`,
`make install BINPREFIX="${tmp}"`
Expand Down
Binary file added vendor/src-pngquant/pngquant-2.10.1-src.tar.gz
Binary file not shown.