From 634cf13d1ebffd7598bb713707be5b174834a3dd Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 19 Oct 2006 23:55:23 +0000 Subject: Improve launch_here script with the suggestions from ticket #112 --- lib/rbot/rbotconfig.rb | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3