Skip to content

Restore the swag command, and guard against losing one again - #135

Merged
ledwards merged 1 commit into
mainfrom
restore-swag
Aug 13, 2026
Merged

Restore the swag command, and guard against losing one again#135
ledwards merged 1 commit into
mainfrom
restore-swag

Conversation

@ledwards

Copy link
Copy Markdown
Contributor

A regression I introduced in #134, plus the test that should have caught it.

What broke

#134 dropped swag from config/commands.js while config/help.js and the README kept advertising it. On production right now, help lists %swag% and typing swag does nothing.

My fault, and worth naming precisely: I had edits to commands.js spread across two working trees (the repo has a git worktree nested inside it) and consolidated them by copying one file over the other. That file predated #132, so the copy silently reverted both of that PR's changes to it — the swag command and a stale comment above www that described the deleted static mirror.

Nothing else from #132 or #133 was affected; they touched different files. Everything #134 added — cowsay, date, wget, the _rickRoll() consolidation — is intact and verified still present.

The guard

The more useful half of this PR. Nothing linked help.js to commands.js, so help could advertise a command that didn't exist and no test would notice.

The new test walks every %command% entry in help.js and asserts a matching function exists in commands.js. I verified it actually catches the bug by removing swag again and confirming the failure:

AssertionError: expected [ 'swag' ] to deeply equal []

Test plan

  • npm test — all passing
  • New test confirmed to fail with the right diagnostic when swag is removed
  • Confirmed cowsay, date, wget and _rickRoll all still present, and zero imgur references remain

🤖 Generated with Claude Code

#134 dropped `swag` from config/commands.js while help.js and the README kept
advertising it, so `help` listed a command that did nothing. My fault: I had
edits to commands.js spread across two working trees and consolidated them by
copying one file over the other, which silently reverted the two changes #132
had made to it — the command itself and a stale comment above `www`.

Both are restored. The new test is the more useful half: nothing linked
config/help.js to config/commands.js, so help could advertise a command that
did not exist and no test would notice. It now walks every %command% in help.js
and asserts a matching function exists.

Verified the test fails with the exact diagnostic (expected [ 'swag' ] to
deeply equal []) when the command is removed again.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ledwards
ledwards merged commit 36a02fd into main Aug 13, 2026
6 checks passed
@ledwards
ledwards deleted the restore-swag branch August 13, 2026 01:58
@ledwards ledwards mentioned this pull request Aug 13, 2026
1 task
ledwards added a commit that referenced this pull request Aug 13, 2026
Removed from commands.js, help.js and the README together — the help/commands
sync test added in #135 requires that, which is the point of it.

Reverts only the command from #132; the README's crawlability rewrite in that
PR stays. To bring it back, restore the three lines:

  config/commands.js  swag: function () { term.openURL("https://rootvc.creator-spring.com"); }
  config/help.js      "%swag%": "rootvc store",
  README.md           - swag: rootvc store

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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