Skip to content

Run the cli-app fixture when it is invoked through its installed bin link - #31

Merged
pekral merged 1 commit into
masterfrom
fix/cli-app-fixture-bin-guard
Nov 12, 2026
Merged

pekral merged 1 commit into
masterfrom
fix/cli-app-fixture-bin-guard

Conversation

@pekral

@pekral pekral commented Nov 12, 2026

Copy link
Copy Markdown
Owner

What this changes

The cli-app benchmark fixture now prints its slug when it runs through the slugify command an install creates, not only when invoked as node bin/slugify.js.

Why

bin/slugify.js guarded its main block with process.argv[1]?.endsWith('slugify.js'). An npm install links slugify to the file, so argv[1] ends in slugify and the command exited 0 with no output. A README that correctly documents npm install --global . and slugify "Hello, World!" (#24) described a command that did nothing. The guard now compares the real path of argv[1] with the module's own path.

Checks

  • node --test tests/repository.test.mjs passes
  • node --test tests/evals/*.test.mjs passes
  • The fixture's own test/cli.test.js passes (3/3) — importing run still prints nothing
  • node bin/slugify.js "Hello, World!" → hello-world; through a symlink named slugify, --sep _ "Hello, World!" → hello_world
  • CHANGELOG.md — not updated; benchmark test data, no change to the skill

…link

bin/slugify.js ran only when argv[1] ended in slugify.js, so the slugify command an install creates printed nothing. Compare the real path of argv[1] with the module's own path instead. Found while fixing #24.
@pekral
pekral merged commit 1f6fed6 into master Nov 12, 2026
2 checks passed
@pekral
pekral deleted the fix/cli-app-fixture-bin-guard branch November 12, 2026 13:44
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.

1 participant