Galerie und tage
This commit is contained in:
27
node_modules/optipng-bin/lib/index.js
generated
vendored
27
node_modules/optipng-bin/lib/index.js
generated
vendored
@@ -1,18 +1,17 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const BinWrapper = require('bin-wrapper');
|
||||
const packageJson = require('../package.json');
|
||||
|
||||
const url = `https://raw.githubusercontent.com/imagemin/optipng-bin/v${packageJson.version}/vendor/`;
|
||||
var path = require('path');
|
||||
var BinWrapper = require('bin-wrapper');
|
||||
var pkg = require('../package.json');
|
||||
var url = 'https://raw.githubusercontent.com/imagemin/optipng-bin/v' + pkg.version + '/vendor/';
|
||||
|
||||
module.exports = new BinWrapper()
|
||||
.src(`${url}macos/optipng`, 'darwin')
|
||||
.src(`${url}linux/x86/optipng`, 'linux', 'x86')
|
||||
.src(`${url}linux/x64/optipng`, 'linux', 'x64')
|
||||
.src(`${url}freebsd/x86/optipng`, 'freebsd', 'x86')
|
||||
.src(`${url}freebsd/x64/optipng`, 'freebsd', 'x64')
|
||||
.src(`${url}sunos/x86/optipng`, 'sunos', 'x86')
|
||||
.src(`${url}sunos/x64/optipng`, 'sunos', 'x64')
|
||||
.src(`${url}win/optipng.exe`, 'win32')
|
||||
.dest(path.resolve(__dirname, '../vendor'))
|
||||
.src(url + 'macos/optipng', 'darwin')
|
||||
.src(url + 'linux/x86/optipng', 'linux', 'x86')
|
||||
.src(url + 'linux/x64/optipng', 'linux', 'x64')
|
||||
.src(url + 'freebsd/x86/optipng', 'freebsd', 'x86')
|
||||
.src(url + 'freebsd/x64/optipng', 'freebsd', 'x64')
|
||||
.src(url + 'sunos/x86/optipng', 'sunos', 'x86')
|
||||
.src(url + 'sunos/x64/optipng', 'sunos', 'x64')
|
||||
.src(url + 'win/optipng.exe', 'win32')
|
||||
.dest(path.join(__dirname, '../vendor'))
|
||||
.use(process.platform === 'win32' ? 'optipng.exe' : 'optipng');
|
||||
|
||||
47
node_modules/optipng-bin/lib/install.js
generated
vendored
47
node_modules/optipng-bin/lib/install.js
generated
vendored
@@ -1,31 +1,32 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const binBuild = require('bin-build');
|
||||
const log = require('logalot');
|
||||
const bin = require('.');
|
||||
var BinBuild = require('bin-build');
|
||||
var log = require('logalot');
|
||||
var bin = require('./');
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
await bin.run(['--version']);
|
||||
log.success('optipng pre-build test passed successfully');
|
||||
} catch (error) {
|
||||
log.warn(error.message);
|
||||
bin.run(function (err) {
|
||||
if (err) {
|
||||
log.warn(err.message);
|
||||
log.warn('optipng pre-build test failed');
|
||||
log.info('compiling from source');
|
||||
|
||||
try {
|
||||
// From https://sourceforge.net/projects/optipng/files/OptiPNG/
|
||||
await binBuild.file(path.resolve(__dirname, '../vendor/source/optipng.tar.gz'), [
|
||||
`./configure --with-system-zlib --prefix="${bin.dest()}" --bindir="${bin.dest()}"`,
|
||||
'make install'
|
||||
]);
|
||||
new BinBuild()
|
||||
.src('https://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-0.7.6/optipng-0.7.6.tar.gz')
|
||||
.cmd([
|
||||
'./configure --with-system-zlib --prefix="' + bin.dest() + '"',
|
||||
'--bindir="' + bin.dest() + '"'
|
||||
].join(' '))
|
||||
.cmd('make install')
|
||||
.run(function (err) {
|
||||
if (err) {
|
||||
log.error(err.stack);
|
||||
return;
|
||||
}
|
||||
|
||||
log.success('optipng built successfully');
|
||||
} catch (error) {
|
||||
log.error(error.stack);
|
||||
log.success('optipng built successfully');
|
||||
});
|
||||
|
||||
// eslint-disable-next-line unicorn/no-process-exit
|
||||
process.exit(1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
})();
|
||||
|
||||
log.success('optipng pre-build test passed successfully');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user