styling fixes; tests passing; added missing ms dependency.

This commit is contained in:
Alberto Miranda
2017-02-06 00:54:16 -03:00
parent c3cdda354e
commit 944eb8b8b0
5 changed files with 14 additions and 19 deletions

View File

@@ -32,6 +32,7 @@
"location-history": "^1.0.0",
"material-ui": "^0.16.0",
"mkdirp": "^0.5.1",
"ms": "^0.7.2",
"musicmetadata": "^2.0.2",
"network-address": "^1.1.0",
"node-notifier": "^5.0.2",

View File

@@ -3,7 +3,6 @@ const fs = require('fs')
const path = require('path')
const electron = require('electron')
const arch = require('arch')
const {resolve} = require('path')
const gaze = require('gaze')
const APP_NAME = 'WebTorrent'
@@ -113,7 +112,7 @@ function updateConfig () {
config = JSON.parse(fs.readFileSync(configFile))
}
function watch() {
function watch () {
gaze(configFile, function (err) {
if (err) {
throw err

View File

@@ -78,7 +78,7 @@ function init () {
// init new plugins then notify user
plugins.subscribe(() => {
// update menu and windows
// update menu and windows
// passing thru new plugin decorators
initApp(state)
})
@@ -106,8 +106,8 @@ function init () {
// init and decorate window
windows.main.init(
state,
{hidden: hidden},
state,
{hidden: hidden},
(options) => plugins.decorateWindow(options)
)
windows.webtorrent.init((options) => plugins.decorateWindow(options))

View File

@@ -20,7 +20,7 @@ let menu = null
function init (decorate) {
let template = getMenuTemplate()
if (decorate) template = decorate(template)
menu = electron.Menu.buildFromTemplate(template)
electron.Menu.setApplicationMenu(menu)
}

View File

@@ -3,6 +3,7 @@ const {resolve, basename} = require('path')
const {writeFileSync} = require('fs')
const State = require('./renderer/lib/state')
const notifier = require('node-notifier')
const {app} = require('electron')
const {sync: mkdirpSync} = require('mkdirp')
const ms = require('ms')
@@ -96,8 +97,8 @@ module.exports = class Plugins {
}
getId (plugins) {
const hash = crypto.createHash('sha256');
hash.update(JSON.stringify(plugins));
const hash = crypto.createHash('sha256')
hash.update(JSON.stringify(plugins))
return hash.digest('hex')
}
@@ -125,9 +126,7 @@ module.exports = class Plugins {
return
}
this.alert(
'Error updating plugins: Check `${this.path}/npm-debug.log` for more information.'
)
this.alert(`Error updating plugins: Check '${this.path}/npm-debug.log' for more information.`)
return
}
@@ -269,13 +268,9 @@ module.exports = class Plugins {
// Use the install command that is appropriate for our shell
exec(installCommands[whichShell], {
cwd: this.path//,
// env,
// shell
cwd: this.path
}, err => {
if (err) {
return fn(err)
}
if (err) return fn(err)
fn(null)
})
}).catch(fn)
@@ -397,11 +392,11 @@ module.exports = class Plugins {
* Logs passed arguments to console using a prefix.
*
*/
function log() {
function log () {
const prefix = '[ PLUGINS ]-->'
const args = [prefix]
for (var i=0; i<arguments.length; ++i) {
for (var i = 0; i < arguments.length; ++i) {
args.push(arguments[i])
}