From ed73e3ad1ed735e7cca10ae859afa03a1fc07d75 Mon Sep 17 00:00:00 2001 From: jake87 Date: Tue, 26 Oct 2021 18:43:21 +1100 Subject: [PATCH] Fixed variable naming issue with file_ops.getTempFile --- packages/lib/file_ops.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/lib/file_ops.js b/packages/lib/file_ops.js index 82cc9846..d14f87f1 100644 --- a/packages/lib/file_ops.js +++ b/packages/lib/file_ops.js @@ -73,14 +73,13 @@ async function getTempFile(prefix, suffix, tmpdir) { prefix = (typeof prefix !== "undefined") ? prefix : "tmp."; suffix = (typeof suffix !== "undefined") ? suffix : ""; tmpdir = tmpdir ? tmpdir : os.tmpdir(); - let fullname = path.join(prefix + crypto.randomBytes(16).toString("hex") + suffix); - let fullpath = path.join(tmpdir, findUnusedName(tmpdir, fullname)); - // If the path is not still zero, return the path, but otherwise return -1 to indicate failure + let fileName = path.join(prefix + crypto.randomBytes(16).toString("hex") + suffix); + let fullPath = path.join(tmpdir, findUnusedName(tmpdir, fullname)); + return fullpath; } module.exports = { getNewestFile, findUnusedName, getTempFile, - checkIfFileExists, };