Skip to content

Commit 9c571cf

Browse files
committed
filter sql from initdb output
1 parent 8a8452f commit 9c571cf

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

wasm-build.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,16 @@ rm -rf ${PGDATA} /tmp/initdb-*.log
218218
${PREFIX}/initdb -k -g -N -U postgres --pwfile=${PREFIX}/password --locale=C --locale-provider=libc --pgdata=${PGDATA} 2> /tmp/initdb-\$\$.log
219219
echo "Ready to run sql command through ${PREFIX}/postgres"
220220
read
221-
tail -n +3 /tmp/initdb-\$\$.log | head -n -2 > /tmp/initdb-\$\$
222-
rm /tmp/initdb-\$\$.log
223-
${PREFIX}/postgres --boot -d 1 -c log_checkpoints=false -X 16777216 -k < /tmp/initdb-\$\$ 2>&1 | grep -v 'bootstrap>'
224-
rm /tmp/initdb-\$\$
221+
222+
grep -v ^initdb.js /tmp/initdb-\$\$.log \\
223+
| tail -n +4 \\
224+
| head -n -1 \\
225+
> /tmp/initdb-\$\$.sql
226+
${PREFIX}/postgres --boot -d 1 -c log_checkpoints=false -X 16777216 -k < /tmp/initdb-\$\$.sql 2>&1 | grep -v 'bootstrap>'
227+
228+
echo clean up
229+
read
230+
rm /tmp/initdb-\$\$.log /tmp/initdb-\$\$.sql
225231
END
226232

227233
chmod +x $PREFIX/*.sh

0 commit comments

Comments
 (0)