Fixed variable naming issue with file_ops.getTempFile

This commit is contained in:
jake87 committed 2021-10-26 20:46:05 +11:00
1 parent 4f9a8fb45c
commit ed73e3ad1e
1 file changed
+3 -4
+3 -4
View File
@@ -73,14 +73,13 @@ async function getTempFile(prefix, suffix, tmpdir) {
prefix = (typeof prefix !== "undefined") ? prefix : "tmp."; prefix = (typeof prefix !== "undefined") ? prefix : "tmp.";
suffix = (typeof suffix !== "undefined") ? suffix : ""; suffix = (typeof suffix !== "undefined") ? suffix : "";
tmpdir = tmpdir ? tmpdir : os.tmpdir(); tmpdir = tmpdir ? tmpdir : os.tmpdir();
let fullname = path.join(prefix + crypto.randomBytes(16).toString("hex") + suffix); let fileName = path.join(prefix + crypto.randomBytes(16).toString("hex") + suffix);
let fullpath = path.join(tmpdir, findUnusedName(tmpdir, fullname)); 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 return fullpath;
} }
module.exports = { module.exports = {
getNewestFile, getNewestFile,
findUnusedName, findUnusedName,
getTempFile, getTempFile,
checkIfFileExists,
}; };