Skip to content

Commit 52ccb8a

Browse files
committed
updating mono check
1 parent 1fde800 commit 52ccb8a

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

tools/checkMono.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1-
const { exec, spawn, spawnSync } = require('child_process');
1+
const { exec } = require('child_process');
22

3-
function exists(cmd){
3+
function exists(cmd, cb){
44
exec(cmd, function (err, stdout, stderr) {
5-
return stdout.toLowerCase().includes('not found') ? false : true;
5+
let result
6+
if(err){
7+
result = false;
8+
}
9+
else{
10+
result = stdout.toLowerCase().includes('not found') || stdout.length === 0 ? false : true
11+
}
12+
cb(result);
613
});
714
}
815

9-
let mono = exists('which mono');
10-
let pkgconfig = exists('which pkg-config');
11-
return mono && pkgconfig;
16+
exists('which mono', (mono)=>{
17+
exists('which pkg-config', (pkgconfig)=>{
18+
console.log(mono && pkgconfig)
19+
});
20+
});
1221

0 commit comments

Comments
 (0)