diff --git a/PBot/PBot.pm b/PBot/PBot.pm index da2ebd55..b0a79617 100644 --- a/PBot/PBot.pm +++ b/PBot/PBot.pm @@ -61,12 +61,14 @@ use PBot::Users; use PBot::Utils::ParseDate; use PBot::WebPaste; +use Encode; +use File::Basename; + # set standard output streams to encode as utf8 binmode(STDOUT, ":utf8"); binmode(STDERR, ":utf8"); # decode command-line arguments from utf8 -use Encode; @ARGV = map { decode('UTF-8', $_, 1) } @ARGV; sub new { @@ -121,6 +123,12 @@ sub initialize { } } + # insist that data directory be copied + if (basename($conf{data_dir}) eq 'data') { + print STDERR "Data directory ($conf{data_dir}) cannot be named `data`. This is to ensure the directory is copied from its default location. Please follow doc/QuickStart.md.\n"; + exit; + } + # let modules register atexit subroutines $self->{atexit} = PBot::Registerable->new(pbot => $self, %conf);