[Jifty-commit] r6244 - in jifty/trunk: lib/Jifty/Script

Jifty commits jifty-commit at lists.jifty.org
Thu Jan 15 08:51:31 EST 2009


Author: sunnavy
Date: Thu Jan 15 08:51:30 2009
New Revision: 6244

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Script/Schema.pm

Log:
 r6269 at sunnavys-mb:  sunnavy | 2009-01-15 21:46:46 +0800
 add --no-bootstrap option for jifty schema cmd


Modified: jifty/trunk/lib/Jifty/Script/Schema.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Script/Schema.pm	(original)
+++ jifty/trunk/lib/Jifty/Script/Schema.pm	Thu Jan 15 08:51:30 2009
@@ -24,6 +24,7 @@
    --create-database  Only creates the database
    --drop-database    Drops the database
    --ignore-reserved-words   Ignore any SQL reserved words in schema definition
+   --no-bootstrap     don't run bootstrap
 
    --help             brief help message
    --man              full documentation
@@ -62,6 +63,10 @@
 Ignore any SQL reserved words used in table or column deffinitions, if
 this option is not used and a reserved word is found it will cause an error.
 
+=item B<--no-bootstrap>
+
+don't run Bootstrap, mostly to get rid of creating initial data
+
 =item B<--help>
 
 Print a brief help message and exits.
@@ -83,6 +88,7 @@
         "create-database|c"     => "create_database",
         "ignore-reserved-words" => "ignore_reserved",
         "drop-database"         => "drop_database",
+        "no-bootstrap"          => "no_bootstrap",
     );
 }
 
@@ -276,19 +282,22 @@
             ( ref $plugin ) . '_db_version' => $pluginv );
     }
 
-    # Load initial data
-    eval {
-        my $bootstrapper = Jifty->app_class("Bootstrap");
-        Jifty::Util->require($bootstrapper);
-        $bootstrapper->run() if $bootstrapper->can('run');
-
-        for my $plugin ( Jifty->plugins ) {
-            my $plugin_bootstrapper = $plugin->bootstrapper;
-            Jifty::Util->require($plugin_bootstrapper);
-            $plugin_bootstrapper->run() if $plugin_bootstrapper->can('run');
-        }
-    };
-    die $@ if $@;
+    unless ( $self->{'no_bootstrap'} ) {
+
+        # Load initial data
+        eval {
+            my $bootstrapper = Jifty->app_class("Bootstrap");
+            Jifty::Util->require($bootstrapper);
+            $bootstrapper->run() if $bootstrapper->can('run');
+
+            for my $plugin ( Jifty->plugins ) {
+                my $plugin_bootstrapper = $plugin->bootstrapper;
+                Jifty::Util->require($plugin_bootstrapper);
+                $plugin_bootstrapper->run() if $plugin_bootstrapper->can('run');
+            }
+        };
+        die $@ if $@;
+    }
 
     # Commit it all
     Jifty->handle->commit;


More information about the Jifty-commit mailing list