diff --git a/.github/utils/config_conversion.sh b/.github/utils/config_conversion.sh index e5cac6882a..50ea6014b8 100755 --- a/.github/utils/config_conversion.sh +++ b/.github/utils/config_conversion.sh @@ -7,18 +7,19 @@ fi input_file=$1 output_file=$2 +ors_file="ors-api/src/test/files/heidelberg.osm.gz" + # Add # to the beginning of each line that is not empty or a comment awk '!/^[[:space:]]*#/ && !/^[[:space:]]*$/ {print "#" $0; next} {print}' "$input_file" > "$output_file" + # Replace '#ors:' with 'ors:' sed -i 's/#ors:/ors:/g' "$output_file" -# Replace '# engine:' with ' engine:' -sed -i 's/# engine:/ engine:/g' "$output_file" -# Replace '# source_file:' with ' source_file: "YOUR_FILE"' -sed -i 's/# source_file:/ source_file: "YOUR_FILE"/g' "$output_file" -# Replace '# profiles:' with ' profiles:' -sed -i 's/# profiles:/ profiles:/g' "$output_file" -# Remove the comments for car and set the profile to true in all cases -awk -i inplace "/# car:/{getline; if (\$0 ~ /# enabled:/) {print \" car:\"; print \" enabled: true\"; next}} {print}" "$output_file" + +# Remove the comments for the engine and source_file section +awk -i inplace "/engine:/{getline; if (\$0 ~ /source_file:/) {print \" engine:\"; print \" source_file: '$ors_file'\"; next}} {print}" "$output_file" + +# Remove the comments for the profiles section for car +awk -i inplace "/# profiles:/{getline; if (\$0 ~ /# car:/) {getline; if (\$0 ~ /# enabled:/) {print \" profiles:\"; print \" car:\"; print \" enabled: true\"; next}}}{print}" "$output_file" echo "Parsing complete. Result saved to $output_file"