Method: PSWindows::Exec#mv

Defined in:
lib/beaker/host/pswindows/exec.rb

#mv(orig, dest, rm = true) ⇒ Object

Move the origin to destination. The destination is removed prior to moving.

Parameters:

  • orig (String)

    The origin path

  • dest (String)

    the destination path

  • rm (Boolean) (defaults to: true)

    Remove the destination prior to move



32
33
34
35
36
37
38
# File 'lib/beaker/host/pswindows/exec.rb', line 32

def mv(orig, dest, rm=true)
  # ensure that we have the right slashes for windows
  orig = orig.gsub(/\//,'\\')
  dest = dest.gsub(/\//,'\\')
  rm_rf dest unless !rm
  execute("move /y #{orig} #{dest}")
end