diff options
Diffstat (limited to 'test/common.js')
-rw-r--r-- | test/common.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/common.js b/test/common.js index 9ac99a1..8c30686 100644 --- a/test/common.js +++ b/test/common.js @@ -2,12 +2,12 @@ const os = require('os') const fs = require('fs') const path = require('path') -exports.getTestPath = function (infix, infoHash) { - let testPath +exports.getDownloadPath = function (infix, infoHash) { + let downloadPath try { - testPath = path.join(fs.statSync('/tmp') && '/tmp', 'webtorrent', 'test') + downloadPath = path.join(fs.statSync('/tmp') && '/tmp', 'webtorrent', 'test') } catch (err) { - testPath = path.join(typeof os.tmpdir === 'function' ? os.tmpdir() : '/', 'webtorrent', 'test') + downloadPath = path.join(typeof os.tmpdir === 'function' ? os.tmpdir() : '/', 'webtorrent', 'test') } - return path.join(testPath, infix, infoHash) + return path.join(downloadPath, infix, infoHash) } |