pgserve 2.6.5 → 2.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -14,6 +14,32 @@ All notable changes to `pgserve` are documented here. The format follows
14
14
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project adheres
15
15
  to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
16
16
 
17
+ ## [2.6.6] - 2026-05-12
18
+
19
+ **Hot-fix follow-up to v2.6.5.** v2.6.5 published to npm but build-tarballs
20
+ still failed with the same `scratch: unbound variable` error because
21
+ v2.6.5's fix (initialize `local scratch=""` before the trap) wasn't
22
+ sufficient — bash's RETURN trap appears to evaluate `$scratch` AFTER
23
+ the function frame is popped, in the parent scope where the local
24
+ is no longer visible.
25
+
26
+ ### Fixed
27
+
28
+ - `scripts/fetch-postgres-bins.sh` (both `stage_from_pkg` and
29
+ `stage_from_url`) — make the RETURN trap unbound-safe regardless of
30
+ bash function-scope quirks by guarding the rm with
31
+ `[[ -n "${scratch:-}" ]] && rm -rf "$scratch"`. Defensive default-empty
32
+ expansion protects against:
33
+ - in-function fire (normal): scratch is a tempdir → rm runs
34
+ - out-of-function fire (bash 5.x scope quirk): scratch is empty → skipped
35
+ - pre-mktemp fire (early return): scratch is empty → skipped
36
+
37
+ ### Same payload as v2.6.5
38
+
39
+ All v2.6.4 + v2.6.5 changes carry forward. v2.6.6 is purely the
40
+ build-tarballs / GH Releases completion. The npm runtime surface is
41
+ identical across v2.6.4/5/6.
42
+
17
43
  ## [2.6.5] - 2026-05-12
18
44
 
19
45
  **Hot-fix follow-up to v2.6.4.** v2.6.4 published to npm cleanly but the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pgserve",
3
- "version": "2.6.5",
3
+ "version": "2.6.6",
4
4
  "description": "Embedded PostgreSQL server with true concurrent connections - zero config, auto-provision databases",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -117,7 +117,7 @@ stage_from_pkg() {
117
117
  # `scratch: unbound variable` and mask the real fetch error
118
118
  # (chatgpt-codex P2 review on PR #84).
119
119
  local scratch=""
120
- trap 'rm -rf "$scratch"' RETURN
120
+ trap '[[ -n "${scratch:-}" ]] && rm -rf "$scratch"' RETURN
121
121
  scratch=$(mktemp -d) || return 1
122
122
 
123
123
  pushd "$scratch" >/dev/null
@@ -161,7 +161,7 @@ stage_from_url() {
161
161
  # masking the real fetch error (codex P2 review on PR #84 fixed this
162
162
  # for stage_from_pkg; stage_from_url was missed at the time).
163
163
  local scratch=""
164
- trap 'rm -rf "$scratch"' RETURN
164
+ trap '[[ -n "${scratch:-}" ]] && rm -rf "$scratch"' RETURN
165
165
  scratch=$(mktemp -d) || return 1
166
166
 
167
167
  curl -fsSL "$url" -o "${scratch}/pg.tar.gz"