Skip to content

Commit a3300dd

Browse files
committedJan 21, 2020
Require Node.js 10
1 parent 58099ed commit a3300dd

File tree

3 files changed

+30
-27
lines changed

3 files changed

+30
-27
lines changed
 

Diff for: ‎.travis.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
sudo: false
21
language: node_js
32
node_js:
3+
- '12'
44
- '10'
5-
- '8'
6-
- '6'

Diff for: ‎lib/install.js

+27-22
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,33 @@ const binBuild = require('bin-build');
44
const log = require('logalot');
55
const bin = require('.');
66

7-
bin.run(['--version']).then(() => {
8-
log.success('gifsicle pre-build test passed successfully');
9-
}).catch(error => {
10-
log.warn(error.message);
11-
log.warn('gifsicle pre-build test failed');
12-
log.info('compiling from source');
7+
(async () => {
8+
try {
9+
await bin.run(['--version']);
10+
log.success('gifsicle pre-build test passed successfully');
11+
} catch (error) {
12+
log.warn(error.message);
13+
log.warn('gifsicle pre-build test failed');
14+
log.info('compiling from source');
1315

14-
const cfg = [
15-
'./configure --disable-gifview --disable-gifdiff',
16-
`--prefix="${bin.dest()}" --bindir="${bin.dest()}"`
17-
].join(' ');
16+
const config = [
17+
'./configure --disable-gifview --disable-gifdiff',
18+
`--prefix="${bin.dest()}" --bindir="${bin.dest()}"`
19+
].join(' ');
1820

19-
binBuild.file(path.resolve(__dirname, '../vendor/source/gifsicle.tar.gz'), [
20-
'autoreconf -ivf',
21-
cfg,
22-
'make install'
23-
]).then(() => {
24-
log.success('gifsicle built successfully');
25-
}).catch(error => {
26-
log.error(error.stack);
21+
try {
22+
await binBuild.file(path.resolve(__dirname, '../vendor/source/gifsicle.tar.gz'), [
23+
'autoreconf -ivf',
24+
config,
25+
'make install'
26+
]);
2727

28-
// eslint-disable-next-line unicorn/no-process-exit
29-
process.exit(1);
30-
});
31-
});
28+
log.success('gifsicle built successfully');
29+
} catch (error2) {
30+
log.error(error2.stack);
31+
32+
// eslint-disable-next-line unicorn/no-process-exit
33+
process.exit(1);
34+
}
35+
}
36+
})();

Diff for: ‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"funding": "https://github.com/imagemin/gisicle-bin?sponsor=1",
88
"bin": "cli.js",
99
"engines": {
10-
"node": ">=6"
10+
"node": ">=10"
1111
},
1212
"scripts": {
1313
"postinstall": "node lib/install.js",
@@ -40,6 +40,6 @@
4040
"bin-check": "^4.0.1",
4141
"compare-size": "^3.0.0",
4242
"tempy": "^0.2.1",
43-
"xo": "^0.18.0"
43+
"xo": "^0.25.3"
4444
}
4545
}

0 commit comments

Comments
 (0)
Please sign in to comment.