Skip to content
This repository has been archived by the owner on Jul 31, 2019. It is now read-only.

Commit

Permalink
Small syntax fix and process.exit for list cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Daly committed Dec 18, 2012
1 parent 8bc97e4 commit 1ef8ae3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 2 additions & 0 deletions lib/app.js
Expand Up @@ -117,5 +117,7 @@ app.exec = function (command, callback) {
if (!_.isUndefined(callback)) {
callback(err);
}

process.exit(1);
});
};
11 changes: 6 additions & 5 deletions lib/commands/list.js
Expand Up @@ -38,8 +38,8 @@ var list = module.exports = function(name, options, callback) {
app.log.info(util.format('%s%s', ('Entry Group: ' + groupName.blue.bold).underline, (app.config.get('currentGroup') === groupName) ? ' (active)'.yellow.bold : ''));
app.log.info('');

entries = entries.sort(support.sortEntries);
entries = entries.sort(support.sortEntries);

if (_.isEmpty(entries)) {
app.log.info('[No entries have been set]'.grey);
} else {
Expand Down Expand Up @@ -68,8 +68,9 @@ var list = module.exports = function(name, options, callback) {

// Allow for arbitrary number of arguments; in this case where no args are passed
if (_.isPlainObject(name)) {
options = name;
name = undefined;
callback = options;
options = name;
name = undefined;
}

// Set defautl --... options
Expand Down Expand Up @@ -136,7 +137,7 @@ var list = module.exports = function(name, options, callback) {
_.each(data.groups, function(entries, groupName) {
listGroup(entries, groupName);
});

listListings(data.listings);
}

Expand Down
10 changes: 5 additions & 5 deletions lib/commands/remove.js
Expand Up @@ -15,15 +15,15 @@ var support = require('../support'),
*/
var remove = module.exports = function(callback) {
"use strict";

// Initialize
var key = 'Entry/Listing ID',
notifyDeletion = function(deleteObj, options) {
options = _.extend({ dryRun: true }, options || {});
var confirmation = 'You are about to delete ID ';

if (!options.dryRun) {
confirmation = 'ID ';
confirmation = 'ID ';
}

confirmation += deleteObj.id.toString().yellow.bold + ', the';
Expand Down Expand Up @@ -54,11 +54,11 @@ var remove = module.exports = function(callback) {


// List the entries/listing with single index
list({
list({
'exit-if-empty': true,
'empty-message': 'there is nothing to delete',
'single-listing': true
});
}, callback);



Expand All @@ -71,7 +71,7 @@ var remove = module.exports = function(callback) {
conform: function(id){
return support.hasEntry(id);
}
}], function(err, result) {
}], function(err, result) {
if (err) {
throw err;
}
Expand Down

0 comments on commit 1ef8ae3

Please sign in to comment.