Skip to content

Commit

Permalink
Merge branch 'next' into release/v2.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
joshedney committed Oct 16, 2024
2 parents cc8e2d3 + 1f50ee4 commit acb5e6d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

### Fixes
- Ensure that the node package is configured correctly so that you can run `npx @bugsnag/cli` and `yarn bugsnag-cli`. [144](https://github.com/bugsnag/bugsnag-cli/pull/144)
- Replace the axios dependency with fetch to reduce the size of the package. [145](https://github.com/bugsnag/bugsnag-cli/pull/144)

## 2.6.1 (2024-09-18)

Expand Down
14 changes: 10 additions & 4 deletions install.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const axios = require('axios');
const fs = require('fs');
const path = require('path');
const os = require('os');
const yaml = require('js-yaml');
const createWriteStream = require('fs').createWriteStream;
const Readable = require('stream').Readable;

const supportedPlatformsConfig = fs.readFileSync(path.join(__dirname, 'supported-platforms.yml'), 'utf8');
const { name, repository, version } = require('./package.json');
Expand Down Expand Up @@ -56,9 +57,14 @@ const downloadBinaryFromGitHub = async (downloadUrl, outputPath) => {
fs.mkdirSync(binDir, { recursive: true });
}

const response = await axios.get(downloadUrl, { responseType: 'arraybuffer' });
const binaryData = response.data;
fs.writeFileSync(outputPath, binaryData, 'binary');
const fileName = downloadUrl.split("/").pop();
const resp = await fetch(downloadUrl);

if (resp.ok && resp.body) {
let writer = createWriteStream(outputPath);
Readable.fromWeb(resp.body).pipe(writer);
}

fs.chmodSync(outputPath, '755');
console.log('Binary downloaded successfully!');
} catch (err) {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
},
"homepage": "https://github.com/bugsnag/bugsnag-cli#readme",
"dependencies": {
"axios": "^1.7.4",
"js-yaml": "^4.1.0"
},
"files": [
Expand Down

0 comments on commit acb5e6d

Please sign in to comment.