File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -16,17 +16,17 @@ VERSION_ARGUMENT=$1
1616
1717# Find and replace the string in all .tf files in the ./testdata/ directory
1818find ./testdata/ -type f -name " *.tf" -exec sed -i.bak " /coder = {/{
19+ # Capture the entire coder block
20+ :a
1921 N
22+ /}/!ba
2023 # Remove any existing version lines
2124 s|[ ]*version[ ]*=[^\\ n]*\\ n||g
22- # Add the new version line
23- s| coder = {| coder = {\n version = \" $VERSION_ARGUMENT \" |
24- # Ensure the source line is correctly formatted
25- s|source[ ]*=[ ]*\" coder/coder\" |source = \" coder/coder\" |
26- s|source[ ]*\" coder/coder\" |source = \" coder/coder\" |
25+ # Replace the coder block with the new format
26+ s| coder = {\n.*}| coder = {\n source = \" coder/coder\" \n version = \" $VERSION_ARGUMENT \" \n }|
2727}" {} +
2828
2929# Remove backup files
3030find ./testdata/ -type f -name " *.bak" -exec rm {} +
3131
32- echo " Replacement complete. Backup files have been removed. "
32+ echo " Replacement complete."
You can’t perform that action at this time.
0 commit comments