Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ee6cd30d70
Fetching contributors…

Cannot retrieve contributors at this time

35 lines (26 sloc) 0.902 kb
name 'growl';
description 'Growl notifications';
author 'Tatsuhiko Miyagawa';
api_version 0.1;
my $growlnotify;
hook init => sub {
my $args = shift;
$growlnotify = $args->{app}->which("growlnotify")
or $args->{app}->diag("! Couldn't find growlnotify. growl plugin is disabled.\n");
};
hook install_success => sub {
my $args = shift;
growl_it($args, 'ToolbarInfo');
};
hook build_failure => sub {
my $args = shift;
growl_it($args, 'AlertStopIcon', 1);
};
sub growl_it {
my($args, $icon, $is_sticky) = @_;
return unless $growlnotify;
my $sticky = $is_sticky ? "-s" : "";
$args->{app}->run("$growlnotify -n cpanminus $sticky -m " . $args->{app}->shell_quote($args->{message}) .
" " . $args->{dist} .
" --image /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/$icon.icns" );
};
Jump to Line
Something went wrong with that request. Please try again.