Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jitsu

Package Overview
Dependencies
Maintainers
6
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jitsu - npm Package Compare versions

Comparing version 0.10.2 to 0.10.3

88

lib/jitsu/commands/apps.js

@@ -32,2 +32,20 @@ /*

function handleStartError(err, name, callback) {
//
// TODO: replace this error handling with errs library
//
if (err.result) {
if (err.result.message === "Cannot start application with no snapshots") {
jitsu.log.error('Cannot start ' + name.magenta + ' since it has no snapshots');
jitsu.log.help('Try running a ' + 'jitsu deploy'.magenta);
return callback({}, null);
}
else if (err.result.error === 'not_found') {
jitsu.log.error('App ' + name.magenta + ' doesn\'t exist on Nodejitsu yet!');
return callback({});
}
}
callback(err);
}
//

@@ -584,28 +602,6 @@ // ### function deploy (callback)

jitsu.apps.start(name, function (err) {
//
// TODO: replace this error handling with errs library
//
if (err && err.result) {
if(err.result.message === "Cannot start application with no snapshots") {
jitsu.log.error('Cannot start ' + name.magenta + ' since it has no snapshots');
jitsu.log.help('Try running a ' + 'jitsu deploy'.magenta);
return callback({}, null);
}
}
//
// TODO: replace this error handling with errs library
//
if (err) {
if (err) {
if(err.result && err.result.error === "not_found") {
jitsu.log.error('App ' + name.magenta + ' doesn\'t exist on Nodejitsu yet!');
return callback({});
}
return callback(err);
}
return handleStartError(err, name, callback);
}
jitsu.apps.view(name, function (err, app) {

@@ -754,1 +750,47 @@ if (err) {

];
//
// ### function setdrones (name, number, callback)
// #### @name {string} **optional** Name of the application to stop.
// #### @callback {function} Continuation to pass control to when complete.
// Stops the application specified by `name`. If no name is supplied
// this will stop the application in the current directory.
//
apps.setdrones = function (name, number, callback) {
function executeSet() {
number = parseInt(number, 10);
jitsu.log.info('Setting number of drones for app ' + name.magenta + ' to ' + number.toString().magenta);
jitsu.apps.setDrones(name, number, function (err) {
if (err) {
return handleStartError(err, name, callback);
}
jitsu.log.info('App ' + name.magenta + ' is now running on ' + number.toString().magenta + ' drones');
callback();
});
}
if (!isNaN(parseInt(name, 10))) {
number = name;
name = null;
}
if (!name) {
return jitsu.package.tryRead(process.cwd(), callback, function (pkg) {
name = pkg.name;
executeSet();
});
}
executeSet();
};
//
// Usage for `jitsu apps setdrones [<name>] <number>`
//
apps.setdrones.usage = [
'Sets number of drones used by the application.',
'',
'jitsu apps stop [<name>] <number>',
];

@@ -11,3 +11,3 @@ {

],
"version": "0.10.2",
"version": "0.10.3",
"author": "Nodejitsu Inc. <info@nodejitsu.com>",

@@ -33,3 +33,3 @@ "maintainers": [

"npm": "1.1.59",
"nodejitsu-api": "0.3.5",
"nodejitsu-api": "0.3.6",
"pkginfo": "0.2.3",

@@ -36,0 +36,0 @@ "request": "2.9.203",

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