module Bundler::FileUtils

def mkdir(list, mode: nil, noop: nil, verbose: nil)


Related: Bundler::FileUtils.mkdir_p.

file or directory, or if for any reason a directory cannot be created.
Raises an exception if any path points to an existing

mkdir -m 700 tmp2 tmp3
mkdir tmp0 tmp1

Output:

Bundler::FileUtils.mkdir(%w[tmp2 tmp3], mode: 0700, verbose: true)
Bundler::FileUtils.mkdir(%w[tmp0 tmp1], verbose: true)

- verbose: true - prints an equivalent command:
- noop: true - does not create directories.
see {File.chmod}[https://docs.ruby-lang.org/en/master/File.html#method-c-chmod].
- mode: mode - also calls File.chmod(mode, path);

Keyword arguments:

Bundler::FileUtils.mkdir('tmp4') # => ["tmp4"]
Bundler::FileUtils.mkdir(%w[tmp0 tmp1]) # => ["tmp0", "tmp1"]

see {Dir.mkdir}[https://docs.ruby-lang.org/en/master/Dir.html#method-c-mkdir]:
by calling: Dir.mkdir(path, mode);
With no keyword arguments, creates a directory at each +path+ in +list+

should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
Argument +list+ or its elements

returns +list+ if it is an array, [list] otherwise.
(a single path or an array of paths);
Creates directories at the paths in the given +list+
def mkdir(list, mode: nil, noop: nil, verbose: nil)
  list = fu_list(list)
  fu_output_message "mkdir #{mode ? ('-m %03o ' % mode) : ''}#{list.join ' '}" if verbose
  return if noop
  list.each do |dir|
    fu_mkdir dir, mode
  end
end