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