Skip to content

Commit

Permalink
Merge pull request #146 from bugsnag/release/v2.6.2
Browse files Browse the repository at this point in the history
v2.6.2 Release
  • Loading branch information
joshedney authored Oct 17, 2024
2 parents cbff01b + acb5e6d commit 63cb657
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 11 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Changelog
## 2.6.2 (2024-10-17)

### 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)

# Fixes
### Fixes
- Ensure that we only pass either `--code-bundle-id` or `--version-code`/`--version-name`/`--bundle-version` to the upload API. [140](https://github.com/bugsnag/bugsnag-cli/pull/140)

## 2.6.0 (2024-09-09)
Expand Down
3 changes: 3 additions & 0 deletions bin/bugsnag-cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env node

console.log("error - bugsnag-cli binary has not been installed successfully")
18 changes: 12 additions & 6 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 @@ -51,14 +52,19 @@ const getPlatformMetadata = () => {

const downloadBinaryFromGitHub = async (downloadUrl, outputPath) => {
try {
const binDir = path.resolve(process.cwd(),'..','..','.bin');
const binDir = path.resolve(process.cwd(),'bin');
if (!fs.existsSync(binDir)) {
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 All @@ -69,6 +75,6 @@ const downloadBinaryFromGitHub = async (downloadUrl, outputPath) => {
const platformMetadata = getPlatformMetadata();
const repoUrl = removeGitPrefixAndSuffix(repository.url);
const binaryUrl = `${repoUrl}/releases/download/v${version}/${platformMetadata.ARTIFACT_NAME}`;
const binaryOutputPath = path.join(process.cwd(),'..','..','.bin', platformMetadata.BINARY_NAME);
const binaryOutputPath = path.join(process.cwd(),'bin', platformMetadata.BINARY_NAME);

downloadBinaryFromGitHub(binaryUrl, binaryOutputPath);
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ display_help() {
EOS
}

VERSION="2.6.1"
VERSION="2.6.2"

while [[ "$#" -gt 0 ]]; do
case "$1" in
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/bugsnag/bugsnag-cli/pkg/utils"
)

var package_version = "2.6.1"
var package_version = "2.6.2"

func main() {
commands := options.CLI{}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bugsnag/cli",
"version": "2.6.1",
"version": "2.6.2",
"description": "BugSnag CLI",
"main": "install.js",
"bin": {
Expand All @@ -20,11 +20,11 @@
},
"homepage": "https://github.com/bugsnag/bugsnag-cli#readme",
"dependencies": {
"axios": "^1.7.4",
"js-yaml": "^4.1.0"
},
"files": [
"install.js",
"bin/bugsnag-cli",
"supported-platforms.yml"
],
"scripts": {
Expand Down

0 comments on commit 63cb657

Please sign in to comment.