Navigation Menu

Skip to content

Commit

Permalink
Confirm to delete domain/fields correctly (don't require double line-…
Browse files Browse the repository at this point in the history
…end)
  • Loading branch information
piroor committed Aug 27, 2012
1 parent 354d287 commit dbb247c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions bin/gcs-configure-fields
Expand Up @@ -46,8 +46,15 @@ if (commandLine.options.delete) {
console.log('You must specify an existing field.');
return process.exit(1);
}
field.deleteSync();
console.log('Updated 1 Index Field:');
commandLine.confirm('Really delete? [' + field.name + '] (y/N) ', function(ok){
if (ok) {
field.deleteSync();
console.log('Updated 1 Index Field:');
process.exit(0);
} else {
process.exit(1);
}
});
} else {
if (!field.exists()) {
if (!commandLine.options.type) {
Expand Down
2 changes: 1 addition & 1 deletion bin/gcs-delete-domain
Expand Up @@ -19,7 +19,7 @@ if (commandLine.options.force) {
commandLine.domain.deleteSync();
console.log('Domain [' + commandLine.domain.name + '] has been deleted successfully.');
} else {
commandLine.confirm('Really delete? [' + commandLine.domain.name + '] (y/N)', function(ok){
commandLine.confirm('Really delete? [' + commandLine.domain.name + '] (y/N) ', function(ok){
if (ok) {
commandLine.domain.deleteSync();
console.log('Successfully deleted.');
Expand Down

0 comments on commit dbb247c

Please sign in to comment.