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 9696
9797 - name : Patch stage2-nix-psql.pkr.hcl to create pg_extensions.json
9898 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'
100105 # Add provisioner to create pg_extensions.json
101106 provisioner "shell" {
102107 inline = [
@@ -105,7 +110,12 @@ jobs:
105110 "echo 'Created pg_extensions.json with content:' && sudo cat /root/pg_extensions.json"
106111 ]
107112 }
113+ }
108114 EOF
115+
116+ # Replace the original file
117+ mv temp.pkr.hcl stage2-nix-psql.pkr.hcl
118+
109119 # Display the modified file to verify
110120 echo "Modified stage2-nix-psql.pkr.hcl:"
111121 tail -n 10 stage2-nix-psql.pkr.hcl
You can’t perform that action at this time.
0 commit comments