From 605af978dc4f4a6a51c6c0cd90521196fa313ecc Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Sat, 1 Sep 2018 05:12:43 +0300 Subject: [PATCH] fix path naming --- src/background/p2p.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/background/p2p.js b/src/background/p2p.js index ff5e75e..4257742 100644 --- a/src/background/p2p.js +++ b/src/background/p2p.js @@ -8,7 +8,7 @@ const isPortReachable = require('./isPortReachable') const EventEmitter = require('events'); const _ = require('lodash') const fs = require('fs') -const path = require('path') +const ph = require('path') class p2p { constructor(send = () => {}) @@ -140,7 +140,7 @@ class p2p { return } - const filePath = path.resolve(this.dataDirectory + '/' + path) + const filePath = ph.resolve(this.dataDirectory + '/' + path) if(!filePath.includes(this.dataDirectory)) { logTE('transfer', 'file get must be from data dir') @@ -411,7 +411,7 @@ class p2p { return } - const fileStream = fs.createWriteStream(this.dataDirectory + '/' + (targetPath || path.basename(path))) + const fileStream = fs.createWriteStream(this.dataDirectory + '/' + (targetPath || ph.basename(path))) let peer = null let deleteCallback = (remotePeer || this).emit('file', {path}, (chunk, nil, addr) => { if(peer && addr !== peer)