Skip to content

Make update-readme.sh work without global mcpc install#258

Merged
jancurn merged 1 commit into
mainfrom
claude/youthful-pasteur-IGm2b
Jun 2, 2026
Merged

Make update-readme.sh work without global mcpc install#258
jancurn merged 1 commit into
mainfrom
claude/youthful-pasteur-IGm2b

Conversation

@jancurn

@jancurn jancurn commented Jun 2, 2026

Copy link
Copy Markdown
Member

Summary

Updates the update-readme.sh script to work independently without requiring a global mcpc installation or running through pnpm run. This improves developer experience and makes the script more robust.

Key Changes

  • PATH setup: Added node_modules/.bin to PATH so project-local dev tools (doctoc, markdown-link-check) are resolvable when the script is run directly
  • Local CLI usage: Changed from calling global mcpc command to using the locally built CLI via node bin/mcpc, eliminating the need for a global installation
  • Auto-build: Added automatic project build if dist/cli/index.js is missing, ensuring the script works even on fresh clones
  • Safety guard: Added validation to ensure mcpc --help produces output before updating the README, preventing accidental data loss if the command fails silently

Implementation Details

The script now:

  1. Prepends the local node_modules/.bin directory to PATH for tool resolution
  2. Checks if the built CLI exists and builds the project if needed (typically a no-op in CI/release workflows)
  3. Invokes the CLI via node "$MCPC_CLI" instead of the global mcpc command
  4. Validates that help output is non-empty before proceeding with README updates, with clear error messaging if validation fails

https://claude.ai/code/session_014Vt5MvUcgyY6Dk8ZTqSM34

The update-readme script invoked the global `mcpc --help`; with no global
install it captured empty output and silently wiped the auto-generated help
block in README.md. Use the locally built CLI (`node bin/mcpc`) instead,
building the project first if `dist/` is missing, and add `node_modules/.bin`
to PATH so doctoc/markdown-link-check resolve even when the script is run
directly. Also abort if the captured help output is empty, so a broken
environment fails loudly instead of emptying the README block.

https://claude.ai/code/session_014Vt5MvUcgyY6Dk8ZTqSM34
@jancurn jancurn merged commit f146a5e into main Jun 2, 2026
6 checks passed
@jancurn jancurn deleted the claude/youthful-pasteur-IGm2b branch June 2, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants