Skip to content

feat: snip all chained commands instead of only the first one#4

Merged
VincentHardouin merged 1 commit into
mainfrom
feat/snip-all-chained-commands
Mar 20, 2026
Merged

feat: snip all chained commands instead of only the first one#4
VincentHardouin merged 1 commit into
mainfrom
feat/snip-all-chained-commands

Conversation

@VincentHardouin
Copy link
Copy Markdown
Owner

Closes #3

Summary

  • Refactor toolExecuteBefore to split commands on all shell operators (&&, ||, ;, &, |) and apply snip to each segment individually instead of only the first command.
  • Extract a reusable snipCommand() helper function.
  • Update existing tests for &&, |, ; and add 4 new test cases (||, &, mixed operators, env vars with &&).
  • Fix cd /tmp && ls to skip cd but still snip ls.

@VincentHardouin VincentHardouin merged commit 51f968e into main Mar 20, 2026
2 checks passed
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.

Snip only runs on the first command

1 participant