mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-24 08:23:12 +09:00
Fixed variable naming issue with file_ops.getTempFile
This commit is contained in:
1 parent
4f9a8fb45c
commit
ed73e3ad1e
1 file changed
+3
-4
@@ -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,
|
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user