File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,8 +156,14 @@ jobs:
156156 shell : bash
157157 run : |
158158 STUB="build/${{ matrix.platform }}/node_modules/@mariozechner/pi-coding-agent/dist/utils/changelog.js"
159+ NEEDS_PATCH=false
159160 if [ ! -f "$STUB" ]; then
160- echo "Patching: creating missing changelog.js stub"
161+ NEEDS_PATCH=true
162+ elif ! grep -q 'export function getChangelogPath' "$STUB" 2>/dev/null; then
163+ NEEDS_PATCH=true
164+ fi
165+ if [ "$NEEDS_PATCH" = true ]; then
166+ echo "Patching: creating/replacing changelog.js stub"
161167 mkdir -p "$(dirname "$STUB")"
162168 cat > "$STUB" <<'STUBEOF'
163169 export function getChangelogPath() { return null }
Original file line number Diff line number Diff line change @@ -87,10 +87,16 @@ npm install "$OPENCLAW_PKG" \
8787
8888popd > /dev/null
8989
90- # --- 3b. Patch: create missing changelog.js stub (upstream bug in @mariozechner/pi-coding-agent) ---
90+ # --- 3b. Patch: ensure changelog.js has required exports (upstream bug in @mariozechner/pi-coding-agent) ---
9191CHANGELOG_STUB=" $BUILD_DIR /node_modules/@mariozechner/pi-coding-agent/dist/utils/changelog.js"
92+ NEEDS_PATCH=false
9293if [ ! -f " $CHANGELOG_STUB " ]; then
93- echo " Patching: creating missing changelog.js stub"
94+ NEEDS_PATCH=true
95+ elif ! grep -q ' export function getChangelogPath' " $CHANGELOG_STUB " 2> /dev/null; then
96+ NEEDS_PATCH=true
97+ fi
98+ if [ " $NEEDS_PATCH " = true ]; then
99+ echo " Patching: creating/replacing changelog.js stub"
94100 mkdir -p " $( dirname " $CHANGELOG_STUB " ) "
95101 cat > " $CHANGELOG_STUB " << 'EOF '
96102export function getChangelogPath() { return null }
Original file line number Diff line number Diff line change @@ -75,10 +75,17 @@ if ($LASTEXITCODE -ne 0) {
7575}
7676Pop-Location
7777
78- # --- 3b. Patch: create missing changelog.js stub (upstream bug in @mariozechner/pi-coding-agent) ---
78+ # --- 3b. Patch: ensure changelog.js has required exports (upstream bug in @mariozechner/pi-coding-agent) ---
7979$changelogStub = " $BuildDir \node_modules\@mariozechner\pi-coding-agent\dist\utils\changelog.js"
80- if (-not (Test-Path $changelogStub )) {
81- Write-Host " Patching: creating missing changelog.js stub" - ForegroundColor Yellow
80+ $needsPatch = -not (Test-Path $changelogStub )
81+ if (-not $needsPatch ) {
82+ $existingContent = Get-Content $changelogStub - Raw - ErrorAction SilentlyContinue
83+ if ($existingContent -notmatch ' export\s+function\s+getChangelogPath' ) {
84+ $needsPatch = $true
85+ }
86+ }
87+ if ($needsPatch ) {
88+ Write-Host " Patching: creating/replacing changelog.js stub" - ForegroundColor Yellow
8289 $stubDir = Split-Path $changelogStub
8390 if (-not (Test-Path $stubDir )) { New-Item - ItemType Directory - Force - Path $stubDir | Out-Null }
8491 @'
You can’t perform that action at this time.
0 commit comments