Fix style issues detected by JSCS

This commit is contained in:
Juan Cruz Viotti 2016-01-21 12:46:23 -04:00
parent 3fb0a747f9
commit 13af009b4c
5 changed files with 15 additions and 11 deletions

View File

@ -127,7 +127,7 @@ imageWriter.service('ImageWriterService', function($q, $timeout, $log) {
* ImageWriterService.setBurning(true); * ImageWriterService.setBurning(true);
*/ */
this.setBurning = function(status) { this.setBurning = function(status) {
burning = !!status; burning = Boolean(status);
}; };
/** /**

View File

@ -105,7 +105,7 @@ selectionState.service('SelectionStateService', function() {
* } * }
*/ */
this.hasDrive = function() { this.hasDrive = function() {
return !!self.getDrive(); return Boolean(self.getDrive());
}; };
/** /**
@ -121,7 +121,7 @@ selectionState.service('SelectionStateService', function() {
* } * }
*/ */
this.hasImage = function() { this.hasImage = function() {
return !!self.getImage(); return Boolean(self.getImage());
}; };
/** /**

View File

@ -51,8 +51,7 @@ exports.require = function(app, callback) {
// Don't keep the original parent process alive // Don't keep the original parent process alive
process.exit(0); process.exit(0);
}); });
} } else if (platform === 'win32') {
else if (platform === 'win32') {
var elevator = require('elevator'); var elevator = require('elevator');
elevator.execute(process.argv, {}, function(error) { elevator.execute(process.argv, {}, function(error) {
@ -64,8 +63,7 @@ exports.require = function(app, callback) {
// Don't keep the original parent process alive // Don't keep the original parent process alive
process.exit(0); process.exit(0);
}); });
} } else {
else {
electron.dialog.showErrorBox( electron.dialog.showErrorBox(
'You don\'t have enough permissions', 'You don\'t have enough permissions',
'Please run this application as root or administrator' 'Please run this application as root or administrator'

View File

@ -37,11 +37,17 @@ var _ = require('lodash');
exports.selectImage = function() { exports.selectImage = function() {
'use strict'; 'use strict';
return new Promise(function(resolve, reject) { return new Promise(function(resolve) {
electron.dialog.showOpenDialog({ electron.dialog.showOpenDialog({
properties: [ 'openFile' ], properties: [ 'openFile' ],
filters: [ filters: [
{ name: 'IMG/ISO', extensions: [ 'img', 'iso' ] } {
name: 'IMG/ISO',
extensions: [
'img',
'iso'
]
}
] ]
}, function(file) { }, function(file) {
return resolve(_.first(file)); return resolve(_.first(file));

View File

@ -87,8 +87,8 @@ exports.writeImage = function(image, drive, onProgress) {
}).then(function() { }).then(function() {
if (isWindows && drive.mountpoint) { if (isWindows && drive.mountpoint) {
return removedrive.ejectAsync(drive.mountpoint); return removedrive.ejectAsync(drive.mountpoint);
} else {
return umount.umountAsync(drive.device);
} }
return umount.umountAsync(drive.device);
}); });
}; };