[Groonga-commit] groonga/gcs [master] Confirm to delete domain/fields correctly (don't require double line-end)

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Aug 27 15:47:00 JST 2012


YUKI Hiroshi	2012-08-27 15:47:00 +0900 (Mon, 27 Aug 2012)

  New Revision: dbb247c5de44ea763c707f68b63e412dfe1d57f5
  https://github.com/groonga/gcs/commit/dbb247c5de44ea763c707f68b63e412dfe1d57f5

  Log:
    Confirm to delete domain/fields correctly (don't require double line-end)

  Modified files:
    bin/gcs-configure-fields
    bin/gcs-delete-domain

  Modified: bin/gcs-configure-fields (+9 -2)
===================================================================
--- bin/gcs-configure-fields    2012-08-24 20:23:00 +0900 (bc3db52)
+++ bin/gcs-configure-fields    2012-08-27 15:47:00 +0900 (ed06a9b)
@@ -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) {

  Modified: bin/gcs-delete-domain (+1 -1)
===================================================================
--- bin/gcs-delete-domain    2012-08-24 20:23:00 +0900 (d587649)
+++ bin/gcs-delete-domain    2012-08-27 15:47:00 +0900 (d3850a2)
@@ -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.');
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index