Skip to content

Commit 09f2f31

Browse files
committed
Minor clean-up of has_lib.js
1 parent ef51cbf commit 09f2f31

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

util/has_lib.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
var query = process.argv[2]
2-
var fs = require('fs')
31
var childProcess = require('child_process')
2+
var fs = require('fs')
43

54
var SYSTEM_PATHS = [
65
'/lib',
@@ -24,7 +23,8 @@ function hasSystemLib (lib) {
2423
// Try using ldconfig on linux systems
2524
if (hasLdconfig()) {
2625
try {
27-
if (childProcess.execSync('ldconfig -p 2>/dev/null | grep -E "' + libName + '"').length) {
26+
if (childProcess.execSync('ldconfig -p 2>/dev/null | grep -E "' +
27+
libName + '"').length) {
2828
return true
2929
}
3030
} catch (err) {
@@ -69,13 +69,13 @@ function hasLdconfig () {
6969
*/
7070
function hasFreetype () {
7171
try {
72-
if (childProcess.execSync('pkg-config cairo --cflags-only-I 2>/dev/null | grep freetype2').length) {
72+
if (childProcess.execSync('pkg-config cairo --cflags-only-I 2>/dev/null | ' +
73+
'grep freetype2').length) {
7374
return true
7475
}
7576
} catch (err) {
76-
// noop
77+
return false
7778
}
78-
return false
7979
}
8080

8181
/**
@@ -118,4 +118,4 @@ function main (query) {
118118
}
119119
}
120120

121-
process.stdout.write(main(query).toString())
121+
process.stdout.write(main(process.argv[2]).toString())

0 commit comments

Comments
 (0)