Skip to content
This repository
Newer
Older
100644 34 lines (26 sloc) 0.902 kb
72c0457c »
2010-02-23 Implemented --list-plugins
1 name 'growl';
2 description 'Growl notifications';
3 author 'Tatsuhiko Miyagawa';
4
5 api_version 0.1;
8d18ac3b »
2010-02-21 Added build_failure and finalize hooks. Fixed init hooks.
6
7 my $growlnotify;
8
9 hook init => sub {
10 my $args = shift;
4be6cb2a »
2010-02-25 Kills Util:: functions which was the left over from the original
11 $growlnotify = $args->{app}->which("growlnotify")
8d18ac3b »
2010-02-21 Added build_failure and finalize hooks. Fixed init hooks.
12 or $args->{app}->diag("! Couldn't find growlnotify. growl plugin is disabled.\n");
13 };
14
15 hook install_success => sub {
16 my $args = shift;
c1ebf3d2 »
2010-02-27 fixed format and grammer of notifications
17 growl_it($args, 'ToolbarInfo');
8d18ac3b »
2010-02-21 Added build_failure and finalize hooks. Fixed init hooks.
18 };
19
20 hook build_failure => sub {
21 my $args = shift;
c1ebf3d2 »
2010-02-27 fixed format and grammer of notifications
22 growl_it($args, 'AlertStopIcon', 1);
f555b76c »
2010-02-21 display icon
23 };
24
25 sub growl_it {
c1ebf3d2 »
2010-02-27 fixed format and grammer of notifications
26 my($args, $icon, $is_sticky) = @_;
f555b76c »
2010-02-21 display icon
27
8d18ac3b »
2010-02-21 Added build_failure and finalize hooks. Fixed init hooks.
28 return unless $growlnotify;
29
f555b76c »
2010-02-21 display icon
30 my $sticky = $is_sticky ? "-s" : "";
c1ebf3d2 »
2010-02-27 fixed format and grammer of notifications
31 $args->{app}->run("$growlnotify -n cpanminus $sticky -m " . $args->{app}->shell_quote($args->{message}) .
32 " " . $args->{dist} .
33 " --image /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/$icon.icns" );
8d18ac3b »
2010-02-21 Added build_failure and finalize hooks. Fixed init hooks.
34 };
Something went wrong with that request. Please try again.