Remove path-exists

This package trivially wraps core node.js functionality. Let's do
without it.
This commit is contained in:
Feross Aboukhadijeh
2016-05-09 16:59:57 +02:00
parent 18b126e0d2
commit 98e263e69a
3 changed files with 13 additions and 5 deletions

View File

@@ -5,9 +5,9 @@
* Useful for developers.
*/
var fs = require('fs')
var os = require('os')
var path = require('path')
var pathExists = require('path-exists')
var rimraf = require('rimraf')
var config = require('../config')
@@ -15,7 +15,12 @@ var handlers = require('../main/handlers')
rimraf.sync(config.CONFIG_PATH)
var tmpPath = path.join(pathExists.sync('/tmp') ? '/tmp' : os.tmpDir(), 'webtorrent')
var tmpPath
try {
tmpPath = path.join(fs.statSync('/tmp') && '/tmp', 'webtorrent')
} catch (err) {
tmpPath = path.join(os.tmpDir(), 'webtorrent')
}
rimraf.sync(tmpPath)
// Uninstall .torrent file and magnet link handlers