Do not manipulate lib path directly.
Perl is a bit fucky about addng paths to @INC directly or via use lib; Also update .gitignore.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,4 +6,5 @@ aleesa-telegram.pid
|
||||
data/cache/**
|
||||
data/admin/**
|
||||
data/config.json
|
||||
data/chatlist.txt
|
||||
vendor_perl/**
|
||||
|
||||
@@ -13,11 +13,31 @@ use warnings;
|
||||
use utf8;
|
||||
use open qw (:std :utf8);
|
||||
use English qw ( -no_match_vars );
|
||||
|
||||
use version; our $VERSION = qw (1.0);
|
||||
|
||||
my $workdir;
|
||||
|
||||
# before we run, change working dir
|
||||
BEGIN {
|
||||
use Cwd qw (chdir abs_path);
|
||||
my @CWD = split /\//xms, abs_path ($PROGRAM_NAME);
|
||||
|
||||
if ($#CWD > 1) {
|
||||
$#CWD = $#CWD - 1;
|
||||
}
|
||||
|
||||
$workdir = join '/', @CWD;
|
||||
chdir $workdir;
|
||||
}
|
||||
|
||||
use lib ("$workdir/lib", "$workdir/vendor_perl", "$workdir/vendor_perl/lib/perl5");
|
||||
no Cwd;
|
||||
|
||||
|
||||
use Data::Dumper qw(Dumper);
|
||||
use JSON::XS ();
|
||||
|
||||
use lib ("./lib", "./vendor_perl", "./vendor_perl/lib/perl5");
|
||||
|
||||
use BotLib::Admin qw(
|
||||
FortuneToggleList FortuneEnabled
|
||||
ChanMsgToggleList ChanMsgEnabled
|
||||
|
||||
Reference in New Issue
Block a user