mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 15:27:17 +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}
|
||||
*/
|
||||
'application/x-bzip2': (imagePath, options) => {
|
||||
return Bluebird.props({
|
||||
return {
|
||||
path: imagePath,
|
||||
archiveExtension: fileExtensions.getLastFileExtension(imagePath),
|
||||
extension: fileExtensions.getPenultimateFileExtension(imagePath),
|
||||
@ -67,7 +67,7 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
transform: unbzip2Stream()
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@ -94,7 +94,7 @@ module.exports = {
|
||||
}
|
||||
})
|
||||
}).then((uncompressedSize) => {
|
||||
return Bluebird.props({
|
||||
return {
|
||||
path: imagePath,
|
||||
archiveExtension: fileExtensions.getLastFileExtension(imagePath),
|
||||
extension: fileExtensions.getPenultimateFileExtension(imagePath),
|
||||
@ -107,7 +107,7 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
transform: zlib.createGunzip()
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@ -223,7 +223,7 @@ module.exports = {
|
||||
* @returns {Promise}
|
||||
*/
|
||||
'application/octet-stream': (imagePath, options) => {
|
||||
return Bluebird.props({
|
||||
return {
|
||||
path: imagePath,
|
||||
extension: fileExtensions.getLastFileExtension(imagePath),
|
||||
stream: fs.createReadStream(imagePath),
|
||||
@ -235,7 +235,7 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
transform: new PassThroughStream()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user