Skip to content

Commit

Permalink
Merge pull request #33 from willthames/ensure-parent-directory-exists
Browse files Browse the repository at this point in the history
Create parent directory for output file
  • Loading branch information
karancode authored Mar 25, 2022
2 parents bd2ee04 + 4c1df41 commit b676f37
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/kustomize_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ function kustomize_build {

# write output to file
if [ -n "${kustomize_output_file}" ]; then
# create parent directory if it doesn't exist
dir=$(dirname "${kustomize_output_file}")
if [ ! -d "${dir}" ]; then
mkdir -p "${dir}"
fi
echo "build: writing output to ${kustomize_output_file}"
cat > "${kustomize_output_file}" <<EOF
${build_output}
Expand Down

0 comments on commit b676f37

Please sign in to comment.