File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 96
96
97
97
- name : Patch stage2-nix-psql.pkr.hcl to create pg_extensions.json
98
98
run : |
99
- cat >> stage2-nix-psql.pkr.hcl << 'EOF'
99
+ # Get the line number of the last closing brace
100
+ LAST_BRACE_LINE=$(grep -n '}' stage2-nix-psql.pkr.hcl | tail -n 1 | cut -d: -f1)
101
+
102
+ # Create a temporary file with the new content
103
+ head -n $((LAST_BRACE_LINE-1)) stage2-nix-psql.pkr.hcl > temp.pkr.hcl
104
+ cat >> temp.pkr.hcl << 'EOF'
100
105
# Add provisioner to create pg_extensions.json
101
106
provisioner "shell" {
102
107
inline = [
@@ -105,7 +110,12 @@ jobs:
105
110
"echo 'Created pg_extensions.json with content:' && sudo cat /root/pg_extensions.json"
106
111
]
107
112
}
113
+ }
108
114
EOF
115
+
116
+ # Replace the original file
117
+ mv temp.pkr.hcl stage2-nix-psql.pkr.hcl
118
+
109
119
# Display the modified file to verify
110
120
echo "Modified stage2-nix-psql.pkr.hcl:"
111
121
tail -n 10 stage2-nix-psql.pkr.hcl
You can’t perform that action at this time.
0 commit comments