def mv(src, dest, options = {})
RealFileUtils.mv src, dest, options.merge(noop: true)
return if options[:noop]
Array(src).each do |path|
if (target = FileSystem.find(path))
dest_path = if File.directory?(dest)
File.join(dest, File.basename(path))
else
dest
end
if File.directory?(dest_path)
fail Errno::EEXIST, dest_path unless options[:force]
elsif File.directory?(File.dirname(dest_path))
FileSystem.delete(dest_path)
FileSystem.add(dest_path, target.entry.clone)
FileSystem.delete(path)
else
fail Errno::ENOENT, dest_path unless options[:force]
end
else
fail Errno::ENOENT, path
end
end
nil
end