From f43164e0f01bee629e46c476548e0cfda2a96038 Mon Sep 17 00:00:00 2001 From: jeb228 Date: Fri, 16 Apr 2010 14:00:05 +0000 Subject: [PATCH] NIHVIVO-241 tweak the file handling, expanding paths properly. --- utilities/licenser/licenser.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/utilities/licenser/licenser.rb b/utilities/licenser/licenser.rb index 3f1ac6abc..aa939d201 100644 --- a/utilities/licenser/licenser.rb +++ b/utilities/licenser/licenser.rb @@ -23,19 +23,19 @@ class Licenser private # ------------------------------------------------------------------------------------ # - # Some paths in the properties file, if they are relative, should be relative to the - # properties file itself. + # Some paths in the properties file, if they are relative, should be relative to the + # properties file itself. def relative_to_properties(properties, key) path = properties[key] 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 - # Some paths in the properties file, if they are relative, should be relative to the - # source directory. + # Some paths in the properties file, if they are relative, should be relative to the + # source directory. def relative_to_source(properties, key) path = properties[key] base = @source_dir ? @source_dir : '' @@ -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)