Skip to content

Commit

Permalink
chart: use while IFS over content instead of sed
Browse files Browse the repository at this point in the history
  • Loading branch information
sonroyaalmerol authored May 21, 2024
1 parent fe24673 commit 4412a1c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions charts/sogo/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,13 @@ spec:
# Get the filename without the directory path
filename=$(basename "$file")
# Read the content of the file and indent each line with two spaces
content=$(sed 's/^/ /' "$file")
content=$(cat "$file")
# Append the filename and content to the YAML file if the content is not empty
if [ -n "$content" ]; then
echo -e "$filename: |-\n$content" >> "$output_file"
echo "$filename: |-" >> "$output_file"
while IFS= read -r line; do
echo " $line" >> "$output_file"
done <<< "$content"
fi
done
EOF
Expand Down

0 comments on commit 4412a1c

Please sign in to comment.