]> git.donarmstrong.com Git - infobot.git/blobdiff - infobot
dunno
[infobot.git] / infobot
diff --git a/infobot b/infobot
index eaa866e99c2024dcd7254e8ee3d159b123f63bbb..ffc3911387e33b9bd2554d97e8704b0e9257091d 100755 (executable)
--- a/infobot
+++ b/infobot
@@ -1,9 +1,9 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
 
 # infobot
 # copyright kevin lenzo (c) 1997-1999
 # copyright david sobon (c) 1999-infinity
-# Copyright (c) 2001-2008 Tim Riker <Tim@Rikers.org>
+# Copyright (c) 2001-2014 Tim Riker <Tim@Rikers.org>
 
 use strict;
 use vars qw($bot_base_dir $bot_src_dir $bot_misc_dir $bot_state_dir
@@ -11,6 +11,11 @@ use vars qw($bot_base_dir $bot_src_dir $bot_misc_dir $bot_state_dir
   $bot_pid $memusage %param
 );
 
+# ancient Perl may not like these, but modern systems should have this
+use open ':utf8';
+use open ':std';
+use Encode qw( decode FB_QUIET );
+
 BEGIN {
     if ( @ARGV and -f $ARGV[0] ) {
 
@@ -19,7 +24,8 @@ BEGIN {
     }
 
     # set any $bot_*_dir var's that aren't already set
-    $bot_base_dir      ||= '/SOME/DIRECTORY/HERE';
+    $bot_base_dir      ||= `pwd`;
+    chomp($bot_base_dir);
     $bot_config_dir    ||= "$bot_base_dir/files/";
     $bot_data_dir      ||= "$bot_base_dir/files/";
     $bot_state_dir     ||= "$bot_base_dir/files/";
@@ -28,8 +34,6 @@ BEGIN {
     $bot_log_dir    ||= "$bot_base_dir/log";
     $bot_misc_dir      ||= "$bot_base_dir/files";
 
-    require "$bot_config_dir/directories";
-
     $bot_pid = $$;
 
     $bot_base_dir = $bot_state_dir;