[Bps-public-commit] SD branch, master, updated. 606d6d4009f62c711e9a9dfc5c1529ed395be6de

sartak at bestpractical.com sartak at bestpractical.com
Mon Mar 16 14:06:03 EDT 2009


The branch, master has been updated
       via  606d6d4009f62c711e9a9dfc5c1529ed395be6de (commit)
      from  4d80ee3fb6015f0ba82dd0b6bdfadd437e725767 (commit)

Summary of changes:
 lib/App/SD/CLI/Command/Browser.pm |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 606d6d4009f62c711e9a9dfc5c1529ed395be6de
Author: Shawn M Moore <sartak at gmail.com>
Date:   Mon Mar 16 14:05:41 2009 -0400

    Give a better message when the user has no opener

diff --git a/lib/App/SD/CLI/Command/Browser.pm b/lib/App/SD/CLI/Command/Browser.pm
index bd9a6cc..408d1ee 100644
--- a/lib/App/SD/CLI/Command/Browser.pm
+++ b/lib/App/SD/CLI/Command/Browser.pm
@@ -14,8 +14,17 @@ sub open_browser {
     my $self = shift;
     my %args = (@_);
     my $opener = $self->open_url_cmd;
+
+    if (!$opener) {
+        warn "I'm unable to figure out what browser I should open for you.\n";
+        return;
+    }
+
     if ($args{url}) {
-        fork || do { sleep 2; exec($opener, $args{url}) };
+        return if fork == 0;
+        sleep 2;
+        exec($opener, $args{url})
+            or die "Couldn't exec $opener: $!";
     }
 }
 

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



More information about the Bps-public-commit mailing list