summaryrefslogtreecommitdiff
path: root/pgruntime/tool_template.sh
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2026-07-31 23:08:39 +0200
committerStefan Majewsky <majewsky@gmx.net>2026-07-31 23:08:39 +0200
commite26a214de3958e48e94cdac0e1ae0641e3221deb (patch)
tree5879b6fdf4e768582c994be2c485a2b36844daa6 /pgruntime/tool_template.sh
parent5bff2a6c9e14763ca8764cf75adba0efbf990e50 (diff)
downloadgo-gg-e26a214de3958e48e94cdac0e1ae0641e3221deb.tar.gz
pgruntime: allow overriding .testdb path
Diffstat (limited to 'pgruntime/tool_template.sh')
-rw-r--r--pgruntime/tool_template.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/pgruntime/tool_template.sh b/pgruntime/tool_template.sh
index d0ddea1..7e3827f 100644
--- a/pgruntime/tool_template.sh
+++ b/pgruntime/tool_template.sh
@@ -1,13 +1,14 @@
#!/usr/bin/env bash
set -euo pipefail
+cd "$(dirname "$0")"
stop_postgres() {
EXIT_CODE=$?
- pg_ctl stop --wait --silent -D .testdb/datadir
+ pg_ctl stop --wait --silent -D datadir
exit "${EXIT_CODE}"
}
trap stop_postgres EXIT INT TERM
-rm -f -- .testdb/run/postgresql.log
-pg_ctl start --wait --silent -D .testdb/datadir -l .testdb/run/postgresql.log
+rm -f -- run/postgresql.log
+pg_ctl start --wait --silent -D datadir -l run/postgresql.log
$COMMAND -U postgres -h 127.0.0.1 -p 54320 "$@"