mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-25 12:16:37 +00:00
Merge branch 'master' into jviotti/feat/41/burn-again
This commit is contained in:
commit
739a191e66
@ -87,7 +87,7 @@ app.controller('AppController', function($q, DriveScannerService, SelectionState
|
|||||||
console.debug('Burning ' + image + ' to ' + drive.device);
|
console.debug('Burning ' + image + ' to ' + drive.device);
|
||||||
return self.writer.burn(image, drive).then(function() {
|
return self.writer.burn(image, drive).then(function() {
|
||||||
console.debug('Done!');
|
console.debug('Done!');
|
||||||
});
|
}).catch(dialog.showError);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.open = shell.openExternal;
|
this.open = shell.openExternal;
|
||||||
@ -127,9 +127,13 @@ var _ = require('lodash');
|
|||||||
var remote = window.require('remote');
|
var remote = window.require('remote');
|
||||||
|
|
||||||
if (window.mocha) {
|
if (window.mocha) {
|
||||||
var drives = remote.require(require('path').join(__dirname, '..', '..', 'src', 'drives'));
|
var path = require('path');
|
||||||
|
var srcPath = path.join(__dirname, '..', '..', 'src');
|
||||||
|
var drives = remote.require(path.join(srcPath, 'drives'));
|
||||||
|
var dialog = remote.require(path.join(srcPath, 'dialog'));
|
||||||
} else {
|
} else {
|
||||||
var drives = remote.require('./src/drives');
|
var drives = remote.require('./src/drives');
|
||||||
|
var dialog = remote.require('./src/dialog');
|
||||||
}
|
}
|
||||||
|
|
||||||
var driveScanner = angular.module('herostratus.drive-scanner', []);
|
var driveScanner = angular.module('herostratus.drive-scanner', []);
|
||||||
@ -235,7 +239,7 @@ driveScanner.service('DriveScannerService', function($q, DriveScannerRefreshServ
|
|||||||
* });
|
* });
|
||||||
*/
|
*/
|
||||||
this.scan = function() {
|
this.scan = function() {
|
||||||
return $q.when(drives.listRemovable());
|
return $q.when(drives.listRemovable()).catch(dialog.showError);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -86,7 +86,7 @@ app.controller('AppController', function($q, DriveScannerService, SelectionState
|
|||||||
console.debug('Burning ' + image + ' to ' + drive.device);
|
console.debug('Burning ' + image + ' to ' + drive.device);
|
||||||
return self.writer.burn(image, drive).then(function() {
|
return self.writer.burn(image, drive).then(function() {
|
||||||
console.debug('Done!');
|
console.debug('Done!');
|
||||||
});
|
}).catch(dialog.showError);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.open = shell.openExternal;
|
this.open = shell.openExternal;
|
||||||
|
@ -30,9 +30,13 @@ var _ = require('lodash');
|
|||||||
var remote = window.require('remote');
|
var remote = window.require('remote');
|
||||||
|
|
||||||
if (window.mocha) {
|
if (window.mocha) {
|
||||||
var drives = remote.require(require('path').join(__dirname, '..', '..', 'src', 'drives'));
|
var path = require('path');
|
||||||
|
var srcPath = path.join(__dirname, '..', '..', 'src');
|
||||||
|
var drives = remote.require(path.join(srcPath, 'drives'));
|
||||||
|
var dialog = remote.require(path.join(srcPath, 'dialog'));
|
||||||
} else {
|
} else {
|
||||||
var drives = remote.require('./src/drives');
|
var drives = remote.require('./src/drives');
|
||||||
|
var dialog = remote.require('./src/dialog');
|
||||||
}
|
}
|
||||||
|
|
||||||
var driveScanner = angular.module('herostratus.drive-scanner', []);
|
var driveScanner = angular.module('herostratus.drive-scanner', []);
|
||||||
@ -138,7 +142,7 @@ driveScanner.service('DriveScannerService', function($q, DriveScannerRefreshServ
|
|||||||
* });
|
* });
|
||||||
*/
|
*/
|
||||||
this.scan = function() {
|
this.scan = function() {
|
||||||
return $q.when(drives.listRemovable());
|
return $q.when(drives.listRemovable()).catch(dialog.showError);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,3 +55,19 @@ exports.selectImage = function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Show error dialog for an Error instance
|
||||||
|
* @function
|
||||||
|
* @public
|
||||||
|
*
|
||||||
|
* @param {Error} error - error
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* dialog.showError(new Error('Foo Bar'));
|
||||||
|
*/
|
||||||
|
exports.showError = function(error) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
dialog.showErrorBox(error.message, error.stack || '');
|
||||||
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user