diff --git a/lib/cmds/repo.js b/lib/cmds/repo.js index 2550a648..6141af43 100644 --- a/lib/cmds/repo.js +++ b/lib/cmds/repo.js @@ -14,6 +14,7 @@ var async = require('async'), git = require('../git'), logger = require('../logger'), open = require('open'), + prompt = require('prompt'), url = require('url'); // -- Constructor -------------------------------------------------------------- @@ -113,12 +114,25 @@ Repo.prototype.run = function() { } if (options.delete) { - logger.logTemplate('{{prefix}} [info] Deleting the repo on {{greenBright options.user "/" options.delete}}', { + logger.logTemplate('{{prefix}} [info] Deleting repo {{greenBright options.user "/" options.delete}}', { options: options }); - instance.delete(function(err1) { - logger.defaultCallback(err1, null); + prompt.get({ + properties: { + confirmation: { + description: 'Are you sure? This action CANNOT be undone. [y/N]' + } + } + }, function (err, result) { + if (result.confirmation.toLowerCase() === 'y') { + instance.delete(function(err1) { + logger.defaultCallback(err1, null); + }); + } + else { + logger.info('Not deleted.'); + } }); }