openclaw/scripts/write-package-dist-inventory.ts
Peter Steinberger 710a38588f
fix: write package inventory through symlinked source paths (#132252)
Package preparation through a symlinked source directory must generate the
postinstall inventory and pending-install guard instead of silently doing
nothing. Match the writer entrypoint through the existing real-path helper
while retaining argv-only activation so imports remain inert despite PM2 hints.

Add real-subprocess regression coverage for canonical and aliased entrypoints
and for imports with absent or same-basename argv and absent or seeded files.

AI-assisted with Codex.
2026-08-28 18:56:03 -07:00

11 lines
519 B
JavaScript

#!/usr/bin/env -S node --import tsx
// Write Package Dist Inventory script supports OpenClaw repository automation.
import { fileURLToPath } from "node:url";
import { isMainModule } from "../src/infra/is-main.ts";
import { writePackageDistInventoryForPublish } from "./lib/package-dist-inventory.ts";
// Match argv only; PM2 hints must not turn an import into a package write.
if (isMainModule({ currentFile: fileURLToPath(import.meta.url), env: {} })) {
await writePackageDistInventoryForPublish(process.cwd());
}