1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-13 12:35:48 +03:00
mobile-nixos/boot/lib/00-monkey_patches/fileutils.rb
2021-01-01 21:37:30 -05:00

14 lines
334 B
Ruby

class FileUtils
def self.mkdir_p(*dirs)
dirs.each do |dir|
$logger.debug(" $ mkdir -p #{dir}")
# Create all paths in the given hierarchy
dir.split("/").reduce("") do |component, acc|
dir = [component, acc].join("/")
Dir.mkdir(dir) unless Dir.exist?(dir)
dir
end
end
end
end