lib: noisy deprecation of child_process customFds
Use a util.deprecate wrapper to issue warnings like any other deprecated API. The option has been marked as deprecated in the docs since v0.5.11. Signed-off-by: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
parent
e1fec22f97
commit
245469587c
@ -804,12 +804,15 @@ exports.execFile = function(file /* args, options, callback */) {
|
|||||||
return child;
|
return child;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var _deprecatedCustomFds = util.deprecate(function(options) {
|
||||||
|
options.stdio = options.customFds.map(function(fd) {
|
||||||
|
return fd === -1 ? 'pipe' : fd;
|
||||||
|
});
|
||||||
|
}, 'child_process: customFds option is deprecated, use stdio instead.');
|
||||||
|
|
||||||
function _convertCustomFds(options) {
|
function _convertCustomFds(options) {
|
||||||
if (options && options.customFds && !options.stdio) {
|
if (options && options.customFds && !options.stdio) {
|
||||||
options.stdio = options.customFds.map(function(fd) {
|
_deprecatedCustomFds(options);
|
||||||
return fd === -1 ? 'pipe' : fd;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user