Module: FileUtils
- Defined in:
- lib/berkshelf/core_ext/file_utils.rb
Class Method Summary collapse
-
.mv(src, dest, options = {}) ⇒ Object
If we encounter Errno::EACCES, which seems to happen occasionally on Windows, try to copy and delete the file instead of moving it.
- .old_mv ⇒ Object
Class Method Details
.mv(src, dest, options = {}) ⇒ Object
If we encounter Errno::EACCES, which seems to happen occasionally on Windows, try to copy and delete the file instead of moving it.
It’s also possible that we get Errno::ENOENT if we try to ‘mv` a relative symlink on Linux
16 17 18 19 20 21 22 |
# File 'lib/berkshelf/core_ext/file_utils.rb', line 16 def mv(src, dest, = {}) old_mv(src, dest, **) rescue Errno::EACCES, Errno::ENOENT .delete(:force) if .key?(:force) FileUtils.cp_r(src, dest, **) FileUtils.rm_rf(src) end |
.old_mv ⇒ Object
5 |
# File 'lib/berkshelf/core_ext/file_utils.rb', line 5 alias_method :old_mv, :mv |