Skip to content

Commit

Permalink
Correct indenting
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Jul 24, 2020
1 parent f703172 commit d49ce83
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions functions/dir_split.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ function extlib::dir_split(Variant[Stdlib::Absolutepath, Array[Stdlib::Absolutep

$dirs_array = [$dirs].flatten.unique.map | Stdlib::Absolutepath $dir | {
$dir.split(shell_escape($sep)).reduce([]) |Array $acc, $value | {
$counter = $acc.length - 1
$acc_value = ($acc[$counter] =~ Undef) ? { true => '', false => $acc[$counter] }
unless empty($value) {
$acc + extlib::path_join([$acc_value, $value])
} else {
$acc
}
$counter = $acc.length - 1
$acc_value = ($acc[$counter] =~ Undef) ? { true => '', false => $acc[$counter] }
unless empty($value) {
$acc + extlib::path_join([$acc_value, $value])
} else {
$acc
}
}
}
$dirs_array.flatten.unique
}
2 changes: 1 addition & 1 deletion functions/mkdir_p.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# @note if you wish to create the directories manually you can use the extlib::dir_split() function in the same manner
function extlib::mkdir_p(Variant[Stdlib::Absolutepath, Array[Stdlib::Absolutepath]] $dirs) >> Array[Stdlib::Absolutepath] {
$dirs_array = extlib::dir_split($dirs)
@file{$dirs_array:
@file { $dirs_array:
ensure => directory,
}
realize(File[$dirs_array])
Expand Down

0 comments on commit d49ce83

Please sign in to comment.