dotfiles/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/js/lib/proxy.js
Cyryl Płotnicki 280bcab25f VSCode update
2016-09-24 13:12:34 +02:00

33 lines
881 B
JavaScript

// Generated by CoffeeScript 1.9.3
(function() {
var child_process;
child_process = require('child_process');
module.exports = function(cmd, max_wait, options) {
var err, orig_write, status, stderr, stdout, t0;
options.timeout = max_wait;
stdout = stderr = '';
status = 0;
t0 = Date.now();
orig_write = process.stderr.write;
process.stderr.write = function() {};
try {
stdout = child_process.execSync(cmd, options);
process.stderr.write = orig_write;
} catch (_error) {
err = _error;
process.stderr.write = orig_write;
if (err.signal === 'SIGTERM' && t0 <= Date.now() - max_wait) {
throw new Error('Timeout');
}
stdout = err.stdout, stderr = err.stderr, status = err.status;
}
return {
stdout: stdout,
stderr: stderr,
status: status
};
};
}).call(this);