The configuration directory is now based on $HOME -> $USERPROFILE -> $Root

git-svn-id: file:///home/svn/framework3/trunk@4548 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2007-03-24 06:41:44 +00:00
parent 769596693b
commit d529f11e9b
1 changed files with 8 additions and 1 deletions

View File

@ -20,9 +20,16 @@ class Config < Hash
#
def self.get_config_root
begin
# First we try $HOME/.msf3
File.expand_path("~#{FileSep}.msf3")
rescue ::ArgumentError
InstallRoot + ".msf3"
# Next we look for USERPROFILE (Windows)
if (ENV['USERPROFILE'] and File.directory?(ENV['USERPROFILE']))
File.join(ENV['USERPROFILE'], '.msf3')
else
# Finally, we give up and user base + ".msf3"
InstallRoot + ".msf3"
end
end
end