Skip to content

Commit

Permalink
fix(setup/nrf52): create the decompression stream when needed (#147)
Browse files Browse the repository at this point in the history
* fix(setup/nrf52): create the decompression stream when needed

* docs(troubleshooting): update XS -> XZ
  • Loading branch information
HipsterBrown committed Sep 29, 2023
1 parent b6357ec commit f2e9b92
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/src/content/docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Other error messages can include:

If you encounter an error message related to lzma or node-lzma, this is likely due to a missing system dependency required to setup the tooling to program nrf52-based devices. This is only required on MacOS and Linux development environments.

To resolve this, install the [XS Utils](https://tukaani.org/xz/) for your system.
To resolve this, install the [XZ Utils](https://tukaani.org/xz/) for your system.

On MacOS, [Homebrew](https://brew.sh) can be used:

Expand Down
3 changes: 1 addition & 2 deletions src/toolbox/setup/nrf52.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,10 @@ export default async function(): Promise<void> {
spinner.start('Downloading GNU Arm Embedded Toolchain')

const writer = isWindows ? ZipExtract({ path: NRF52_DIR }) : extract(NRF52_DIR, { readable: true })
const unxz = createUnxz()
const response = await axios.get(TOOLCHAIN_DOWNLOAD, {
responseType: 'stream',
})
const stream = isWindows ? response.data : response.data.pipe(unxz)
const stream = isWindows ? response.data : response.data.pipe(createUnxz())
stream.pipe(writer)
await finishedPromise(writer)
spinner.succeed()
Expand Down

0 comments on commit f2e9b92

Please sign in to comment.