Remove extra filesystem dependencies
This commit is contained in:
@@ -242,8 +242,7 @@ function uninstallWin32 () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function installLinux () {
|
function installLinux () {
|
||||||
var fs = require('fs')
|
var fs = require('fs-extra')
|
||||||
var mkdirp = require('mkdirp')
|
|
||||||
var os = require('os')
|
var os = require('os')
|
||||||
var path = require('path')
|
var path = require('path')
|
||||||
|
|
||||||
@@ -277,7 +276,7 @@ function installLinux () {
|
|||||||
'applications',
|
'applications',
|
||||||
'webtorrent-desktop.desktop'
|
'webtorrent-desktop.desktop'
|
||||||
)
|
)
|
||||||
mkdirp(path.dirname(desktopFilePath))
|
fs.mkdirp(path.dirname(desktopFilePath))
|
||||||
fs.writeFile(desktopFilePath, desktopFile, function (err) {
|
fs.writeFile(desktopFilePath, desktopFile, function (err) {
|
||||||
if (err) return log.error(err.message)
|
if (err) return log.error(err.message)
|
||||||
})
|
})
|
||||||
@@ -298,7 +297,7 @@ function installLinux () {
|
|||||||
'icons',
|
'icons',
|
||||||
'webtorrent-desktop.png'
|
'webtorrent-desktop.png'
|
||||||
)
|
)
|
||||||
mkdirp(path.dirname(iconFilePath))
|
fs.mkdirp(path.dirname(iconFilePath))
|
||||||
fs.writeFile(iconFilePath, iconFile, function (err) {
|
fs.writeFile(iconFilePath, iconFile, function (err) {
|
||||||
if (err) return log.error(err.message)
|
if (err) return log.error(err.message)
|
||||||
})
|
})
|
||||||
@@ -308,7 +307,7 @@ function installLinux () {
|
|||||||
function uninstallLinux () {
|
function uninstallLinux () {
|
||||||
var os = require('os')
|
var os = require('os')
|
||||||
var path = require('path')
|
var path = require('path')
|
||||||
var rimraf = require('rimraf')
|
var fs = require('fs-extra')
|
||||||
|
|
||||||
var desktopFilePath = path.join(
|
var desktopFilePath = path.join(
|
||||||
os.homedir(),
|
os.homedir(),
|
||||||
@@ -317,7 +316,7 @@ function uninstallLinux () {
|
|||||||
'applications',
|
'applications',
|
||||||
'webtorrent-desktop.desktop'
|
'webtorrent-desktop.desktop'
|
||||||
)
|
)
|
||||||
rimraf.sync(desktopFilePath)
|
fs.removeSync(desktopFilePath)
|
||||||
|
|
||||||
var iconFilePath = path.join(
|
var iconFilePath = path.join(
|
||||||
os.homedir(),
|
os.homedir(),
|
||||||
@@ -326,5 +325,5 @@ function uninstallLinux () {
|
|||||||
'icons',
|
'icons',
|
||||||
'webtorrent-desktop.png'
|
'webtorrent-desktop.png'
|
||||||
)
|
)
|
||||||
rimraf.sync(iconFilePath)
|
fs.removeSync(iconFilePath)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ var electron = require('electron')
|
|||||||
var fs = require('fs')
|
var fs = require('fs')
|
||||||
var os = require('os')
|
var os = require('os')
|
||||||
var path = require('path')
|
var path = require('path')
|
||||||
var pathExists = require('path-exists')
|
|
||||||
|
|
||||||
var app = electron.app
|
var app = electron.app
|
||||||
|
|
||||||
@@ -118,7 +117,8 @@ function updateShortcuts (cb) {
|
|||||||
var desktopShortcutPath = path.join(homeDir, 'Desktop', 'WebTorrent.lnk')
|
var desktopShortcutPath = path.join(homeDir, 'Desktop', 'WebTorrent.lnk')
|
||||||
// Check if the desktop shortcut has been previously deleted and and keep it deleted
|
// Check if the desktop shortcut has been previously deleted and and keep it deleted
|
||||||
// if it was
|
// if it was
|
||||||
pathExists(desktopShortcutPath).then(function (desktopShortcutExists) {
|
fs.access(desktopShortcutPath, function (err) {
|
||||||
|
var desktopShortcutExists = !err
|
||||||
createShortcuts(function () {
|
createShortcuts(function () {
|
||||||
if (desktopShortcutExists) {
|
if (desktopShortcutExists) {
|
||||||
cb()
|
cb()
|
||||||
|
|||||||
@@ -29,12 +29,9 @@
|
|||||||
"hyperx": "^2.0.2",
|
"hyperx": "^2.0.2",
|
||||||
"languagedetect": "^1.1.1",
|
"languagedetect": "^1.1.1",
|
||||||
"main-loop": "^3.2.0",
|
"main-loop": "^3.2.0",
|
||||||
"mkdirp": "^0.5.1",
|
|
||||||
"musicmetadata": "^2.0.2",
|
"musicmetadata": "^2.0.2",
|
||||||
"network-address": "^1.1.0",
|
"network-address": "^1.1.0",
|
||||||
"path-exists": "^2.1.0",
|
|
||||||
"prettier-bytes": "^1.0.1",
|
"prettier-bytes": "^1.0.1",
|
||||||
"rimraf": "^2.5.2",
|
|
||||||
"simple-get": "^2.0.0",
|
"simple-get": "^2.0.0",
|
||||||
"srt-to-vtt": "^1.1.1",
|
"srt-to-vtt": "^1.1.1",
|
||||||
"upload-element": "^1.0.1",
|
"upload-element": "^1.0.1",
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ var WebTorrent = require('webtorrent')
|
|||||||
var defaultAnnounceList = require('create-torrent').announceList
|
var defaultAnnounceList = require('create-torrent').announceList
|
||||||
var deepEqual = require('deep-equal')
|
var deepEqual = require('deep-equal')
|
||||||
var electron = require('electron')
|
var electron = require('electron')
|
||||||
var fs = require('fs')
|
var fs = require('fs-extra')
|
||||||
var mkdirp = require('mkdirp')
|
|
||||||
var musicmetadata = require('musicmetadata')
|
var musicmetadata = require('musicmetadata')
|
||||||
var networkAddress = require('network-address')
|
var networkAddress = require('network-address')
|
||||||
var path = require('path')
|
var path = require('path')
|
||||||
@@ -192,7 +191,7 @@ function generateTorrentPoster (torrentKey) {
|
|||||||
torrentPoster(torrent, function (err, buf, extension) {
|
torrentPoster(torrent, function (err, buf, extension) {
|
||||||
if (err) return console.log('error generating poster: %o', err)
|
if (err) return console.log('error generating poster: %o', err)
|
||||||
// save it for next time
|
// save it for next time
|
||||||
mkdirp(config.CONFIG_POSTER_PATH, function (err) {
|
fs.mkdirp(config.CONFIG_POSTER_PATH, function (err) {
|
||||||
if (err) return console.log('error creating poster dir: %o', err)
|
if (err) return console.log('error creating poster dir: %o', err)
|
||||||
var posterFileName = torrent.infoHash + extension
|
var posterFileName = torrent.infoHash + extension
|
||||||
var posterFilePath = path.join(config.CONFIG_POSTER_PATH, posterFileName)
|
var posterFilePath = path.join(config.CONFIG_POSTER_PATH, posterFileName)
|
||||||
|
|||||||
Reference in New Issue
Block a user