Last active
August 29, 2015 14:01
-
-
Save schlueter/f3889a1298940ca63eec to your computer and use it in GitHub Desktop.
Recursively create folders with chef
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
split_path = path.split('/') | |
split_path.each_with_index.map do | _, index | | |
# Reconstruct each path that makes up the target path and ensure they are created | |
partial_path = ::File.join split_path.slice(0, index + 1) | |
next if partial_path == '' | |
directory partial_path do | |
owner node[:oracle][:database][:install_user] | |
group node[:oracle][:database][:install_group] | |
mode 0775 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment