Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[api] always prompts on app destruction

  • Loading branch information...
commit 3e1880651d575cf7ef173e88b6340eb2430d259f 1 parent 23cb2e6
@blakmatrix blakmatrix authored
Showing with 16 additions and 18 deletions.
  1. +16 −18 lib/jitsu/commands/apps.js
View
34 lib/jitsu/commands/apps.js
@@ -543,7 +543,7 @@ apps.update.usage = [
//
apps.destroy = function (name, callback) {
-//
+ //
// Allows arbitrary amount of arguments
//
if(arguments.length) {
@@ -551,32 +551,30 @@ apps.destroy = function (name, callback) {
callback = args.callback;
name = args[0] || null;
}
-
- function executeDestroy() {
- jitsu.log.info('Destroying app ' + name.magenta);
- jitsu.apps.destroy(name, function (err) {
- jitsu.log.silly('Done destroying app ' + name.magenta);
- return err ? callback(err) : callback();
- });
- }
-
if (!name) {
jitsu.package.tryRead(process.cwd(), callback, function (pkg) {
jitsu.log.info('Attempting to destroy app ' + pkg.name.magenta);
name = pkg.name;
- jitsu.prompt.confirm('yes/no', function(err, result){
- if (result) {
- executeDestroy();
- } else {
- jitsu.log.info('app ' + pkg.name.magenta + ' was not destroyed');
- callback(null);
- }
- });
+ executeDestroy();
});
} else {
executeDestroy();
}
+ function executeDestroy() {
+ jitsu.log.info('Destroy app ' + name.magenta);
+ jitsu.prompt.confirm('yes/no', { default: 'yes'}, function(err, result){
+ if (result) {
+ jitsu.apps.destroy(name, function (err) {
+ jitsu.log.silly('Done destroying app ' + name.magenta);
+ return err ? callback(err) : callback();
+ });
+ } else {
+ jitsu.log.info('app ' + name.magenta + ' was not destroyed');
+ callback(null);
+ }
+ });
+ }
};
//
Please sign in to comment.
Something went wrong with that request. Please try again.