UNPKG

610 BJavaScriptView Raw
1'use strict';
2const binBuild = require('bin-build');
3const log = require('logalot');
4const bin = require('.');
5
6bin.run(['--verbose']).then(() => {
7 log.success('guetzli pre-build test passed successfully');
8}).catch(error => {
9 log.warn(error.message);
10 log.warn('guetzli pre-build test failed');
11 log.info('compiling from source');
12
13 binBuild.url('https://github.com/google/guetzli/archive/v1.0.1.tar.gz', [
14 `mkdir -p ${bin.dest()}`,
15 `make && mv bin/Release/${bin.use()} ${bin.path()}`
16 ]).then(() => {
17 log.success('guetzli built successfully');
18 }).catch(error => {
19 log.error(error.stack);
20 });
21});