Skip to content

fix(table-generator): run the CLI when invoked from a Windows path - #35

Open
Dusk1e wants to merge 1 commit into
shelby:mainfrom
Dusk1e:fix/table-generator-cli-entrypoint
Open

fix(table-generator): run the CLI when invoked from a Windows path#35
Dusk1e wants to merge 1 commit into
shelby:mainfrom
Dusk1e:fix/table-generator-cli-entrypoint

Conversation

@Dusk1e

@Dusk1e Dusk1e commented Aug 14, 2026

Copy link
Copy Markdown

Summary

The entry point guard compares import.meta.url with a template string built from process.argv[1], which is a filesystem path and not a URL, so it never matches on Windows or on any path that needs percent encoding. main() never runs, and pnpm update-table and pnpm check-table both exit 0 without doing anything.

Now compares against pathToFileURL(process.argv[1]).href.

Tests

Before, tsx src/cli.ts --help printed nothing and exited 0. After, it prints the help text.

After, tsx src/cli.ts --check runs the scan and reports the table status instead of exiting silently.

biome check clean on the changed file.


Note

Low Risk
Single-file CLI bootstrap fix with no auth, data, or API surface changes; restores intended behavior on Windows.

Overview
Fixes the table-generator CLI so main() actually runs when the script is executed directly.

The direct-execution check compared import.meta.url to `file://${process.argv[1]}`, which is wrong because process.argv[1] is a filesystem path, not a URL. That guard never matched on Windows (drive letters, backslashes) or when paths need percent-encoding, so pnpm update-table / pnpm check-table could exit 0 without updating or checking anything.

The guard now uses pathToFileURL(process.argv[1]).href for a proper file-URL comparison, with a short comment explaining why.

Reviewed by Cursor Bugbot for commit f318f8e. Bugbot is set up for automated code reviews on this repo. Configure here.

The entry-point guard compared import.meta.url against a template string
built from process.argv[1]. argv[1] is a filesystem path, not a URL, so on
Windows it never matches the percent-encoded module URL and main() never
runs: pnpm update-table and pnpm check-table both exit 0 without doing
anything. The same happens on any path that needs percent-encoding, such as
one containing a space.

Compare against pathToFileURL(process.argv[1]).href instead.
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