lib/gitback/repository.rb in gitback-0.1.3 vs lib/gitback/repository.rb in gitback-0.1.4
- old
+ new
@@ -41,9 +41,15 @@
FileUtils.mkdir_p(dirname)
end
# Copy the file(s) to the repo
if File.exists?(file_path)
+ # Make sure we only copy the directory contents,
+ # not the directory itself.
+ if File.directory?(file_path)
+ file_path += '/.'
+ end
+
# We pass remove_destination to avoid issues with symlinks
FileUtils.cp_r file_path, dest_path, :remove_destination => true
else
puts "ERROR: '#{file_path}' doesn't seem to exist."
end