Skip to content

Commit

Permalink
Use pipeline instead of .pipe when downloading OS image
Browse files Browse the repository at this point in the history
Change-type: patch
  • Loading branch information
Page- committed Nov 9, 2023
1 parent 47a1a9c commit 55750ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/utils/cloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ export async function downloadOSImage(
output = fs.createWriteStream(outputPath);
}

const streamToPromise = await import('stream-to-promise');
await streamToPromise(stream.pipe(output));
const { pipeline } = await import('node:stream/promises');
await pipeline(stream, output);

console.info(
`balenaOS image version ${displayVersion} downloaded successfully`,
Expand Down

0 comments on commit 55750ef

Please sign in to comment.