Socket
Socket
Sign inDemoInstall

heroku-cli-util

Package Overview
Dependencies
Maintainers
2
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heroku-cli-util - npm Package Compare versions

Comparing version 1.10.4 to 1.11.0

43

command.js

@@ -6,13 +6,34 @@ 'use strict';

function handleErr(err) {
if (err.body) {
if (err.body.message) {
errors.error(err.body.message);
} else if (err.body.error) {
errors.error(err.body.error);
function handleErr (context) {
return function (err) {
if (err.body) {
// API error
if (err.body.message) {
errors.error(err.body.message);
} else if (err.body.error) {
errors.error(err.body.error);
}
} else {
// Unhandled error
if (err.message) {
errors.error(err.message);
} else {
errors.error(err);
}
if (err.stack) {
var logPath = context.herokuDir + '/error.log';
var fs = require('fs');
var log = function (line) {
var d = new Date().toISOString()
.replace(/T/, ' ')
.replace(/-/g, '/')
.replace(/\..+/, '');
fs.appendFileSync(logPath, d + ' ' + line + '\n');
};
log(err.stack);
errors.error(`See ${logPath}` + logPath + ' for more info.');
}
}
} else {
console.error(err.stack);
}
process.exit(1);
process.exit(1);
};
}

@@ -29,4 +50,4 @@

yield fn(context, heroku);
}).catch(handleErr);
}).catch(handleErr(context));
};
};

@@ -6,7 +6,7 @@ 'use strict';

function error (msg) {
console.error(chalk.red(` ! ${msg}`));
console.error(' ' + chalk.bgRed('!') + ' ' + msg);
}
function warn (msg) {
console.error(chalk.yellow(` ! ${msg}`));
console.error(' ' + chalk.bgYellow('!') + ' ' + msg);
}

@@ -13,0 +13,0 @@

{
"name": "heroku-cli-util",
"version": "1.10.4",
"version": "1.11.0",
"description": "Set of helpful CLI utilities",

@@ -5,0 +5,0 @@ "main": "cli.js",

@@ -65,4 +65,9 @@ # heroku-cli-util

Used for initializing a plugin command
Used for initializing a plugin command.
It will set the `cwd` to the user's current location,
give you an auth'ed instance of `heroku-client`,
and cleanly handle API exceptions.
It uses `co` so you can `yield` promises.
```js

@@ -69,0 +74,0 @@ let h = require('heroku-cli-util');

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc