wallet-core/node_modules/tmp/test/graceful-sync.js

21 lines
319 B
JavaScript
Raw Normal View History

2017-05-03 15:35:00 +02:00
var
tmp = require('../lib/tmp'),
spawn = require('./spawn-sync');
var graceful = spawn.arg;
if (graceful) {
tmp.setGracefulCleanup();
}
try {
var result = spawn.tmpFunction();
spawn.out(result.name, function () {
throw new Error('Thrown on purpose');
});
}
catch (e) {
spawn.err(e, spawn.exit);
}