mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 07:17:18 +00:00
Merge pull request #2131 from resin-io/fix-device-pass
fix(gui): Fix devices passed to writer
This commit is contained in:
commit
8bd9ff58c4
@ -69,16 +69,14 @@ const getApplicationEntryPoint = () => {
|
||||
* This function is extracted for testing purposes.
|
||||
*
|
||||
* @param {String} image - image path
|
||||
* @param {Array<Object>} drives - drives
|
||||
* @param {Array<String>} drives - drives
|
||||
* @param {Function} onProgress - in progress callback (state)
|
||||
*
|
||||
* @fulfil {Object} - flash results
|
||||
* @returns {Promise}
|
||||
*
|
||||
* @example
|
||||
* imageWriter.performWrite('path/to/image.img', {
|
||||
* device: '/dev/disk2'
|
||||
* }, (state) => {
|
||||
* imageWriter.performWrite('path/to/image.img', [ '/dev/disk2' ], (state) => {
|
||||
* console.log(state.percentage)
|
||||
* })
|
||||
*/
|
||||
@ -138,7 +136,7 @@ exports.performWrite = (image, drives, onProgress) => {
|
||||
ipc.server.on('ready', (data, socket) => {
|
||||
ipc.server.emit(socket, 'write', {
|
||||
imagePath: image,
|
||||
destinations: _.map(drives, [ 'device' ]),
|
||||
destinations: drives,
|
||||
validateWriteOnSuccess: settings.get('validateWriteOnSuccess'),
|
||||
unmountOnSuccess: settings.get('unmountOnSuccess'),
|
||||
checksumAlgorithms: [ 'sha512' ]
|
||||
@ -229,13 +227,11 @@ exports.performWrite = (image, drives, onProgress) => {
|
||||
* This function will update `imageWriter.state` with the current writing state.
|
||||
*
|
||||
* @param {String} image - image path
|
||||
* @param {Array<Object>} drives - drives
|
||||
* @param {Array<String>} drives - drives
|
||||
* @returns {Promise}
|
||||
*
|
||||
* @example
|
||||
* imageWriter.flash('foo.img', [{
|
||||
* device: '/dev/disk2'
|
||||
* }]).then(() => {
|
||||
* imageWriter.flash('foo.img', [ '/dev/disk2' ]).then(() => {
|
||||
* console.log('Write completed!')
|
||||
* })
|
||||
*/
|
||||
|
@ -72,7 +72,7 @@ module.exports = function (
|
||||
|
||||
const iconPath = '../../../assets/icon.png'
|
||||
|
||||
imageWriter.flash(image.path, [ drive ]).then(() => {
|
||||
imageWriter.flash(image.path, [ drive.device ]).then(() => {
|
||||
if (!flashState.wasLastFlashCancelled()) {
|
||||
notification.send('Success!', {
|
||||
body: messages.info.flashComplete(path.basename(image.path), drive),
|
||||
|
Loading…
x
Reference in New Issue
Block a user