summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-10-19 23:55:23 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-10-19 23:55:23 +0000
commit634cf13d1ebffd7598bb713707be5b174834a3dd (patch)
tree8a0450301a966ded6d81375b616671c6eeda408d /lib
parent676b3fb7fddc8d35b3ae20c59f4a3ddd7b4039c5 (diff)
Improve launch_here script with the suggestions from ticket #112
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/rbotconfig.rb23
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/rbot/rbotconfig.rb b/lib/rbot/rbotconfig.rb
index 409ab9f8..a282d770 100644
--- a/lib/rbot/rbotconfig.rb
+++ b/lib/rbot/rbotconfig.rb
@@ -1,18 +1,23 @@
module Irc
module Config
- @@datadir = nil
- @@coredir = nil
+ unless defined?(@@datadir)
+ @@datadir = nil
- # first try for the default path to the data dir
- defaultdatadir = File.expand_path(File.dirname($0) + '/../data/rbot')
- defaultcoredir = File.expand_path(File.dirname($0) + '/../lib/rbot/core')
+ defaultdatadir = File.expand_path(File.dirname($0) + '/../data/rbot')
- if File.directory? defaultdatadir
- @@datadir = defaultdatadir
+ if File.directory? defaultdatadir
+ @@datadir = defaultdatadir
+ end
end
- if File.directory? defaultcoredir
- @@coredir = defaultcoredir
+ unless defined?(@@coredir)
+ @@coredir = nil
+
+ defaultcoredir = File.expand_path(File.dirname($0) + '/../lib/rbot/core')
+
+ if File.directory? defaultcoredir
+ @@coredir = defaultcoredir
+ end
end
# setup pkg-based configuration - i.e. where were we installed to, where