1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-24 08:23:33 +03:00
mobile-nixos/boot/init/lib/monkey_patches/fileutils.rb
2020-02-03 16:19:10 -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