Galerie und tage
This commit is contained in:
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