Skip to content

Commit 89a1dc8

Browse files
@jotadevelopersergiohgz
authored andcommitted
fix: temp files are written into the storage
1 parent fe386c4 commit 89a1dc8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/local-storage/src/local-fs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,12 @@ class LocalFS implements ILocalPackageManager {
172172

173173
const pathName: string = this._getStorage(name);
174174

175-
fs.exists(pathName, function(exists) {
175+
fs.exists(pathName, (exists) => {
176176
if (exists) {
177177
return uploadStream.emit('error', fSError(fileExist));
178178
}
179179

180-
const temporalName = `${name}.tmp-${String(Math.random()).replace(/^0\./, '')}`;
180+
const temporalName = path.join(this.path, `${name}.tmp-${String(Math.random()).replace(/^0\./, '')}`);
181181
const file = fs.createWriteStream(temporalName);
182182
let opened = false;
183183
uploadStream.pipe(file);

0 commit comments

Comments
 (0)