82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
# File 'lib/fetchers/git.rb', line 82
def perform_relative_path_fetch(destination_path, working_dir)
Inspec::Log.debug("Checkout of #{resolved_ref} successful. " \
"Moving #{@relative_path} to #{destination_path}")
unless File.exist?("#{working_dir}/#{@relative_path}")
FileUtils.rmdir(destination_path) if Dir.empty?(destination_path)
raise ArgumentError, "Cannot find relative path '#{@relative_path}' " \
"within profile in git repo specified by '#{@remote_url}'"
end
FileUtils.cp_r("#{working_dir}/#{@relative_path}", destination_path)
end
|