Skip to content

Commit

Permalink
New gitpull command
Browse files Browse the repository at this point in the history
  • Loading branch information
grickit committed Apr 30, 2016
1 parent 6b77619 commit 6f7e621
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions modules/PluginParser/Staff/GitPull.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package PluginParser::Staff::GitPull;
use strict;
use warnings;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(match);

sub match {
my ($self,$core) = @_;
if($core->{'receiver_nick'} ne $core->{'botname'}) { return ''; }
if($core->{'event'} ne 'on_public_message' and $core->{'event'} ne 'on_private_message') { return ''; }


if($core->{'message'} =~ /^gitpull$/) {
return git_pull($core);
}

return '';
}

sub git_pull {
my ($core,$chan) = @_;
if(!$core->{'auth'}->test_sender($core,'global_staff')) { $core->{'auth'}->error($core,'global_staff'); return ''; }

my $home_directory = $core->value_get('core','home_directory');
$core->child_add('gitpull',"git pull ${home_directory} 1>&2 ");
}

1 change: 1 addition & 0 deletions parsers/plugin_parser2/jane.pl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
module_load('PluginParser::Basic::CTCP');
module_load('PluginParser::Basic::Hug');
module_load('PluginParser::Staff::JoinPart');
module_load('PluginParser::Staff::GitPull');
module_load('PluginParser::Temperature');
module_load('PluginParser::Time');
module_load('PluginParser::Conversation::EDBlock');
Expand Down

0 comments on commit 6f7e621

Please sign in to comment.