Skip to content

Commit

Permalink
fix: added silent flag
Browse files Browse the repository at this point in the history
  • Loading branch information
niftylettuce committed Dec 16, 2019
1 parent 40515c6 commit 6dfaaed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ const filePath = path.join(__dirname, 'spfcheck2.py');
// ensure python installed
if (!which('python3')) throw new Error(`Python v3.5+ is required`);

const silent = process.env.NODE_ENV !== 'test';

// ensure python v3.5+
let version = exec('python3 --version');
let version = exec('python3 --version', { silent });
version = semver.coerce(
(version.stdout || version.stderr).split(' ')[1].trim()
);
Expand All @@ -22,6 +24,7 @@ module.exports = function(ip, address, host) {
return new Promise((resolve, reject) => {
exec(
`python3 ${filePath} ${ip} ${address} ${host}`,
{ silent },
(code, stdout, stderr) => {
if (code !== 0) return reject(new Error(stderr));
resolve(stdout.trim().split(','));
Expand Down

0 comments on commit 6dfaaed

Please sign in to comment.