Skip to content

Commit

Permalink
Merge 2543c32 into 227747e
Browse files Browse the repository at this point in the history
  • Loading branch information
russellsteadman committed Jun 13, 2018
2 parents 227747e + 2543c32 commit b9e71db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/process-streams.js
Expand Up @@ -34,30 +34,30 @@ function createStream (tmpIn, tmpOut, callback) {
if (tmpIn) {
fs.exists(tmpIn, function (exists) {
if (exists) {
fs.unlink(tmpIn)
fs.unlink(tmpIn, function () {})
}
})
}
if (tmpOut) {
fs.exists(tmpOut, function (exists) {
if (exists) {
fs.unlink(tmpOut)
fs.unlink(tmpOut, function () {})
}
})
}
return
}
// tmpFile is not needed anymore
if (tmpIn) {
fs.unlink(tmpIn)
fs.unlink(tmpIn, function () {})
}
if (tmpOut) {
fs.exists(tmpOut, function (exists) {
if (exists) {
var out = fs.createReadStream(tmpOut)
out.pipe(outgoing)
out.on('end', function () {
fs.unlink(tmpOut)
fs.unlink(tmpOut, function () {})
})
} else {
result.emit('error', new Error('Child process has not created the output-temp file'))
Expand Down

0 comments on commit b9e71db

Please sign in to comment.