mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 19:26:33 +00:00
refactor(image-stream): Remove Promise props resolve (#1726)
This removes `Bluebird.props()` from the image type handlers, as it's just a remnant when some properties in the return value were Promises that needed resolving. Change-Type: patch Connects To: #1724
This commit is contained in:
parent
70edfa384b
commit
a3c54f22c8
@ -54,7 +54,7 @@ module.exports = {
|
|||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
'application/x-bzip2': (imagePath, options) => {
|
'application/x-bzip2': (imagePath, options) => {
|
||||||
return Bluebird.props({
|
return {
|
||||||
path: imagePath,
|
path: imagePath,
|
||||||
archiveExtension: fileExtensions.getLastFileExtension(imagePath),
|
archiveExtension: fileExtensions.getLastFileExtension(imagePath),
|
||||||
extension: fileExtensions.getPenultimateFileExtension(imagePath),
|
extension: fileExtensions.getPenultimateFileExtension(imagePath),
|
||||||
@ -67,7 +67,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
transform: unbzip2Stream()
|
transform: unbzip2Stream()
|
||||||
})
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -94,7 +94,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}).then((uncompressedSize) => {
|
}).then((uncompressedSize) => {
|
||||||
return Bluebird.props({
|
return {
|
||||||
path: imagePath,
|
path: imagePath,
|
||||||
archiveExtension: fileExtensions.getLastFileExtension(imagePath),
|
archiveExtension: fileExtensions.getLastFileExtension(imagePath),
|
||||||
extension: fileExtensions.getPenultimateFileExtension(imagePath),
|
extension: fileExtensions.getPenultimateFileExtension(imagePath),
|
||||||
@ -107,7 +107,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
transform: zlib.createGunzip()
|
transform: zlib.createGunzip()
|
||||||
})
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ module.exports = {
|
|||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
'application/octet-stream': (imagePath, options) => {
|
'application/octet-stream': (imagePath, options) => {
|
||||||
return Bluebird.props({
|
return {
|
||||||
path: imagePath,
|
path: imagePath,
|
||||||
extension: fileExtensions.getLastFileExtension(imagePath),
|
extension: fileExtensions.getLastFileExtension(imagePath),
|
||||||
stream: fs.createReadStream(imagePath),
|
stream: fs.createReadStream(imagePath),
|
||||||
@ -235,7 +235,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
transform: new PassThroughStream()
|
transform: new PassThroughStream()
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user