devenv: fix volumes section when sources don't contain one (#111563)

This commit is contained in:
Charandas 2025-09-25 07:18:14 -07:00 committed by GitHub
parent 397e4957f0
commit dc626e897b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 10 deletions

View File

@ -64,13 +64,6 @@ for dir in $@; do
fi
done
volume_files=$($blocks_dir/**/$compose_volume_section_create_flag)
if [[ ${#volume_files[@]} -ne 0 ]]; then
echo "Adding volume section to $compose_file"
cat $compose_volume_section_file >> $compose_file
echo "" >> $compose_file
for dir in $@; do
current_dir=$blocks_dir/$dir
if [ ! -d "$current_dir" ]; then
@ -80,11 +73,15 @@ if [[ ${#volume_files[@]} -ne 0 ]]; then
if [ -f $current_dir/$compose_volume_section_create_flag ]; then
if [ -z ${inserted_volume_section_start+x} ]; then
echo "Adding volume section to $compose_file"
cat $compose_volume_section_file >> $compose_file
echo "" >> $compose_file
inserted_volume_section_start=true
fi
echo "Adding volume for $current_dir to $compose_file"
echo " $dir-data-volume:" >> $compose_file
echo "" >> $compose_file
fi
done
cat $compose_file
fi