mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 19:26:33 +00:00
Fix style issues detected by JSCS
This commit is contained in:
parent
3fb0a747f9
commit
13af009b4c
@ -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);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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());
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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'
|
||||||
|
@ -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));
|
||||||
|
@ -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);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user