schnee effeckt und fehler Korektur

This commit is contained in:
2023-08-14 17:52:24 +02:00
parent 4a843d4936
commit 79af4e9907
6813 changed files with 343821 additions and 356128 deletions

View File

@@ -1,32 +1,30 @@
'use strict';
var BinBuild = require('bin-build');
var log = require('logalot');
var bin = require('./');
const path = require('path');
const binBuild = require('bin-build');
const bin = require('./index.js');
bin.run(function (err) {
if (err) {
log.warn(err.message);
log.warn('optipng pre-build test failed');
log.info('compiling from source');
(async () => {
try {
await bin.run(['--version']);
console.log('optipng pre-build test passed successfully');
} catch (error) {
console.warn(error.message);
console.warn('optipng pre-build test failed');
console.info('compiling from source');
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;
}
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'
]);
log.success('optipng built successfully');
});
console.log('optipng built successfully');
} catch (error) {
console.error(error.stack);
return;
// eslint-disable-next-line unicorn/no-process-exit
process.exit(1);
}
}
log.success('optipng pre-build test passed successfully');
});
})();