Method: Unix::Exec#mkdir_p

Defined in:
lib/beaker/host/unix/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



150
151
152
153
154
# File 'lib/beaker/host/unix/exec.rb', line 150

def mkdir_p dir
  cmd = "mkdir -p #{dir}"
  result = exec(Beaker::Command.new(cmd), :acceptable_exit_codes => [0, 1])
  result.exit_code == 0
end