Method: PSWindows::Exec#mkdir_p

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

#mkdir_p(dir) ⇒ Boolean

Create the provided directory structure on the host

Parameters:

  • dir (String)

    The directory structure to create on the host

Returns:

  • (Boolean)

    True, if directory construction succeeded, otherwise False



74
75
76
77
78
79
# File 'lib/beaker/host/pswindows/exec.rb', line 74

def mkdir_p dir
  windows_dirstring = dir.gsub('/','\\')
  cmd = "if not exist #{windows_dirstring} (md #{windows_dirstring})"
  result = exec(Beaker::Command.new(cmd), :acceptable_exit_codes => [0, 1])
  result.exit_code == 0
end