diff options
| author | Ailin Nemui | 2016-02-06 00:32:52 +0100 | 
|---|---|---|
| committer | Ailin Nemui | 2016-02-06 00:34:14 +0100 | 
| commit | a3ee2cf2b5d41d09aba945228dda4d15820e890b (patch) | |
| tree | 237a40c8fa150eedae87b9bac5297cccfa62e1eb /_testing/_irssi_test.pl | |
| parent | 85ed11e8aa971dfaedb5610cc82ef0de9b9c5522 (diff) | |
| download | scripts.irssi.org-a3ee2cf2b5d41d09aba945228dda4d15820e890b.tar.bz2 | |
better package detection for multi-scripts
Diffstat (limited to '_testing/_irssi_test.pl')
| -rw-r--r-- | _testing/_irssi_test.pl | 7 | 
1 files changed, 6 insertions, 1 deletions
| diff --git a/_testing/_irssi_test.pl b/_testing/_irssi_test.pl index aeeb1d1..f1eb998 100644 --- a/_testing/_irssi_test.pl +++ b/_testing/_irssi_test.pl @@ -15,7 +15,12 @@ Irssi::command('^window log on');  Irssi::command("script load $CURRENT_SCRIPT");  Irssi::command('^window log off'); -my ($package) = grep { !/^_/ } keys %Irssi::Script::; +my (@packages) = grep { !/^_/ } keys %Irssi::Script::; +my $tp = $CURRENT_SCRIPT; $tp =~ s/^.*\///; $tp =~ s/\W/_/g; my @tmp; +if ((@tmp = grep /^\Q$tp\E::/, @packages) or (@tmp = grep /^\Q$tp\E/, @packages)) { +    @packages = @tmp; +} +my ($package) = @packages;  require YAML::Tiny;  YAML::Tiny->VERSION("1.59"); | 
