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
16
16
17
17
# Find and replace the string in all .tf files in the ./testdata/ directory
18
18
find ./testdata/ -type f -name " *.tf" -exec sed -i.bak " /coder = {/{
19
+ # Capture the entire coder block
20
+ :a
19
21
N
22
+ /}/!ba
20
23
# Remove any existing version lines
21
24
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 }|
27
27
}" {} +
28
28
29
29
# Remove backup files
30
30
find ./testdata/ -type f -name " *.bak" -exec rm {} +
31
31
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