module Bovem::ShellMethods::Write

Methods to copy or move entries.

Public Instance Methods

copy(src, dst, run: true, show_errors: false, fatal_errors: true) click to toggle source

Copies a set of files or directory to another location.

@param src [String|Array] The entries to copy. If is an Array, `dst` is assumed to be a directory. @param dst [String] The destination. **Any existing entries will be overwritten.** Any required directory will be created. @param run [Boolean] If `false`, it will just print a list of message that would be copied or moved. @param show_errors [Boolean] If show errors. @param fatal_errors [Boolean] If quit in case of fatal errors. @return [Boolean] `true` if operation succeeded, `false` otherwise.

# File lib/bovem/shell.rb, line 142
def copy(src, dst, run: true, show_errors: false, fatal_errors: true)
  copy_or_move(src, dst, operation: :copy, run: run, show_errors: show_errors, fatal_errors: fatal_errors)
end
move(src, dst, run: true, show_errors: false, fatal_errors: true) click to toggle source

Moves a set of files or directory to another location.

@param src [String|Array] The entries to move. If is an Array, `dst` is assumed to be a directory. @param dst [String] The destination. **Any existing entries will be overwritten.** Any required directory will be created. @param run [Boolean] If `false`, it will just print a list of message that would be deleted. @param show_errors [Boolean] If show errors. @param fatal_errors [Boolean] If quit in case of fatal errors. @return [Boolean] `true` if operation succeeded, `false` otherwise.

# File lib/bovem/shell.rb, line 154
def move(src, dst, run: true, show_errors: false, fatal_errors: true)
  copy_or_move(src, dst, operation: :move, run: run, show_errors: show_errors, fatal_errors: fatal_errors)
end