NIHVIVO-241 tweak the file handling, expanding paths properly.

This commit is contained in:
jeb228 2010-04-16 14:00:05 +00:00
parent ff36a1b06d
commit f43164e0f0

View file

@ -30,7 +30,7 @@ class Licenser
base = File.dirname(properties['properties_file_path'])
return nil if path == nil
return path if Pathname.new(path).absolute?
return File.expand_path(path) if Pathname.new(path).absolute?
return File.expand_path(File.join(base, path))
end
@ -126,7 +126,7 @@ class Licenser
def scan_dir(source_dir, target_dir)
@stats.enter_directory(source_dir)
Dir.mkdir(File.join(@target_dir, target_dir)) if !@scan_only
Dir.mkdir(File.expand_path(target_dir, @target_dir)) if !@scan_only
Dir.foreach(File.join(@source_dir, source_dir)) do |filename|
source_path_relative = File.join(source_dir, filename)