From 65f66328ae480d517991ae2e2508ad408da68f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Wed, 1 Mar 2017 18:52:59 -0800 Subject: [PATCH] fix(put-stream): remove tmp file on stream insert error --- lib/content/put-stream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/content/put-stream.js b/lib/content/put-stream.js index b8504f5..4860844 100644 --- a/lib/content/put-stream.js +++ b/lib/content/put-stream.js @@ -115,7 +115,7 @@ function pipeToTmp (inputStream, cache, tmpTarget, opts, errCheck) { pipe(inputStream, hashStream, outStream, err => { errCheck() if (err) { - reject(err) + rimraf(tmpTarget).then(() => reject(err), reject) } else { resolve(digest) }