hexo/node_modules/ssh2-streams/test/test.js

23 lines
561 B
JavaScript
Raw Normal View History

2023-10-03 11:14:36 +08:00
var spawn = require('child_process').spawn,
join = require('path').join;
var files = require('fs').readdirSync(__dirname).filter(function(f) {
return (f.substr(0, 5) === 'test-');
}).map(function(f) {
return join(__dirname, f);
}),
f = -1;
function next() {
if (++f < files.length) {
spawn(process.argv[0], [ files[f] ], { stdio: 'inherit' })
.on('exit', function(code) {
if (code === 0)
process.nextTick(next);
else
process.exit(code);
});
}
}
next();