Method not available on this version
This method is only available on newer versions. The first available version of the method is shown here.
mkdir_p(list, mode: nil, noop: nil, verbose: nil)
private
Creates a directory and all its parent directories. For example,
Bundler::FileUtils.mkdir_p '/usr/local/lib/ruby'
causes to make following directories, if it does not exist.
-
/usr
-
/usr/local
-
/usr/local/lib
-
/usr/local/lib/ruby
You can pass several directories at a time in a list.
Show source
def mkdir_p(list, mode: nil, noop: nil, verbose: nil)
list = fu_list(list)
fu_output_message "mkdir -p #{mode ? ('-m %03o ' % mode) : ''}#{list.join ' '}" if verbose
return *list if noop
list.map {|path| remove_trailing_slash(path)}.each do |path|
begin
fu_mkdir path, mode
next
rescue SystemCallError
next if File.directory?(path)
end
stack = []
until path == stack.last
stack.push path
path = File.dirname(path)
end
stack.pop
stack.reverse_each do |dir|
begin
fu_mkdir dir, mode
rescue SystemCallError
raise unless File.directory?(dir)
end
end
end
return *list
end