Don't print env vars if Node's execFileSync fails

Just print the error message, to avoid printing sensitive information
(like API access tokens).
This commit is contained in:
Oliver Hamlet
2016-12-05 23:51:45 +00:00
parent c7436586ce
commit aec6962039
4 changed files with 17 additions and 7 deletions
+10
View File
@@ -1,5 +1,6 @@
// Helper functions shared across scripts.
'use strict';
const childProcess = require('child_process');
const path = require('path');
const fs = require('fs');
const os = require('os');
@@ -87,7 +88,16 @@ function getMetadataValidatorBinaryPaths(rootPath) {
return getBinaryPaths(rootPath, file);
}
function safeExecFileSync(file, args, options) {
try {
childProcess.execFileSync(file, args, options);
} catch (error) {
throw new Error(error.message);
}
}
module.exports.fileExists = fileExists;
module.exports.getAppReleasePaths = getAppReleasePaths;
module.exports.getApiBinaryPaths = getApiBinaryPaths;
module.exports.getMetadataValidatorBinaryPaths = getMetadataValidatorBinaryPaths;
module.exports.safeExecFileSync = safeExecFileSync;