Skip to content

Commit

Permalink
fix: temp files are written into the storage
Browse files Browse the repository at this point in the history
  • Loading branch information
@jotadeveloper authored and sergiohgz committed Aug 13, 2019
1 parent fe386c4 commit 89a1dc8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/local-storage/src/local-fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ class LocalFS implements ILocalPackageManager {

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

fs.exists(pathName, function(exists) {
fs.exists(pathName, (exists) => {
if (exists) {
return uploadStream.emit('error', fSError(fileExist));
}

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

0 comments on commit 89a1dc8

Please sign in to comment.