Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/bagit/bag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def add_file(relative_path, src_path = nil)
f = if src_path.nil?
File.open(path, "w") { |io| yield io }
else
FileUtils.cp src_path, path
FileUtils.cp_r src_path, path
end
write_bag_info
f
Expand All @@ -92,7 +92,7 @@ def add_file(relative_path, src_path = nil)
def remove_file(relative_path)
path = File.join(data_dir, relative_path)
raise "Bag file does not exist: #{relative_path}" unless File.exist? path
FileUtils.rm path
FileUtils.rm_r path
end

# Retrieve the IO handle for a file in the bag at a given path relative to
Expand Down