[Bps-public-commit] SD - A distributed issue tracker branch, master, updated. d3e38918cbfb7e25f40bffb98af9763f84cbeb4b

jesse jesse at bestpractical.com
Tue Jan 27 22:11:28 EST 2009


The branch, master has been updated
       via  d3e38918cbfb7e25f40bffb98af9763f84cbeb4b (commit)
      from  a289954060f4e505f9017103dac9250d1e9c1e64 (commit)

Summary of changes:
 lib/App/SD/CLI/Command/Shell.pm |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit d3e38918cbfb7e25f40bffb98af9763f84cbeb4b
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Jan 27 21:37:28 2009 -0500

    'sd' withou a replica works again - Fix for 152EC7F4-ECDE-11DD-8E40-8DA88F31E82D

diff --git a/lib/App/SD/CLI/Command/Shell.pm b/lib/App/SD/CLI/Command/Shell.pm
index f0b164e..1bdc080 100644
--- a/lib/App/SD/CLI/Command/Shell.pm
+++ b/lib/App/SD/CLI/Command/Shell.pm
@@ -5,14 +5,27 @@ extends 'Prophet::CLI::Command::Shell';
 has project_name => (
     isa => 'Str',
     is => 'rw',
-    default => sub { shift->app_handle->setting( label => 'project_name' )->get()->[0]; }
+    default => sub { my $self = shift;
+                     if ($self->app_handle->handle->replica_exists) {
+                            return $self->app_handle->setting( label => 'project_name' )->get()->[0]; 
+                        } else {
+                            'No database found';
+                        }
+                        }
     );
 
 sub preamble {
     my $self = shift;
-    return join "\n",
-        "SD for ".$self->project_name." ($App::SD::VERSION; Prophet $Prophet::VERSION)",
-        'Type "help", "about", or "copying" for more information.',
+     my @out = (   "SD for ".$self->project_name." ($App::SD::VERSION; Prophet $Prophet::VERSION)",
+        'Type "help", "about", or "copying" for more information.');
+
+    if (!$self->app_handle->handle->replica_exists) {
+        push @out, '', "No SD database was found at ".$self->app_handle->handle->url(),
+        'Type "help init" and "help environment" for tips on how to sort that out.'
+    }
+
+    return join("\n", at out);
+
 }
 
 sub prompt {

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list