avo 3.2.7 → 3.2.9-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cli.js +19 -9
  2. package/package.json +3 -3
package/cli.js CHANGED
@@ -176,7 +176,12 @@ function _request(options) {
176
176
  if (response.statusCode >= 400) {
177
177
  return reject(responseToError(response));
178
178
  }
179
- return resolve(JSON.parse(response.body));
179
+ else if (response) {
180
+ return resolve(JSON.parse(response.body));
181
+ }
182
+ else {
183
+ return reject(responseToError(response));
184
+ }
180
185
  })
181
186
  .catch((err) => {
182
187
  report.error(`${responseToError(err.response)}\n`);
@@ -1338,14 +1343,19 @@ yargs(hideBin(process.argv)) // eslint-disable-line no-unused-expressions
1338
1343
  command: 'track-install',
1339
1344
  desc: false,
1340
1345
  handler: async (argv) => {
1341
- Avo.cliInstalled({
1342
- userId_: installIdOrUserId(),
1343
- cliInvokedByCi: invokedByCi(),
1344
- }).catch((error) => {
1345
- if (argv.verbose) {
1346
- console.error('Failed to track cli installed', error);
1347
- }
1348
- });
1346
+ try {
1347
+ Avo.cliInstalled({
1348
+ userId_: installIdOrUserId(),
1349
+ cliInvokedByCi: invokedByCi(),
1350
+ }).catch((error) => {
1351
+ if (argv.verbose) {
1352
+ console.error('Request to track cli installed failed', error);
1353
+ }
1354
+ });
1355
+ }
1356
+ catch (error) {
1357
+ console.error('Unexpected error failed to track cli installed', error);
1358
+ }
1349
1359
  },
1350
1360
  })
1351
1361
  .command({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "avo",
3
- "version": "3.2.7",
3
+ "version": "3.2.9-beta.0",
4
4
  "type": "module",
5
5
  "description": "The command-line interface for Avo",
6
6
  "author": "Avo (https://www.avo.app)",
@@ -62,9 +62,9 @@
62
62
  "@typescript-eslint/parser": "^5.30.5",
63
63
  "eslint": "^7.32.0 || ^8.2.0",
64
64
  "eslint-config-airbnb-base": "^15.0.0",
65
- "eslint-config-prettier": "^8.5.0",
65
+ "eslint-config-prettier": "^9.0.0",
66
66
  "eslint-plugin-import": "^2.25.2",
67
- "prettier": "2.8.8",
67
+ "prettier": "3.0.3",
68
68
  "typescript": "^5.0.2"
69
69
  }
70
70
  }