Skip to content

fix: remove shell syntax from run() in 4 tools#305

Open
TerminalGravity wants to merge 2 commits intomainfrom
fix/shell-syntax-batch-2
Open

fix: remove shell syntax from run() in 4 tools#305
TerminalGravity wants to merge 2 commits intomainfrom
fix/shell-syntax-batch-2

Conversation

@TerminalGravity
Copy link
Collaborator

Fixes shell syntax passed to run() (which uses execFileSync without a shell) in:

  • sharpen-followup.ts: array args for diff/status calls
  • checkpoint.ts: split compound && staging+commit into separate run() calls, removed dead addCmd variable
  • sequence-tasks.ts: array args for ls-files, JS .slice() instead of | head
  • session-handoff.ts: execFileSync('which') instead of command -v ... 2>/dev/null, direct execFileSync('gh') with try/catch instead of || echo

Part of #302. 4 of 9 affected files now fixed (PR #301 fixed what-changed.ts).

All tests pass, clean tsc --noEmit.

Replace shell syntax (pipes, redirects, 2>/dev/null) passed to run()
with proper array args and Node.js equivalents:

- token-audit: use Node fs for line/byte counting and tail reads
- enrich-agent-task: filter git ls-files output in JS instead of grep/head pipes
- clarify-intent: use execFileSync for tsc, Node fs for finding test files
- audit-workspace: use array args for git diff, Node fs for counting test files

scan-sessions.ts was already clean (uses fs directly, not run()).

Closes the remaining files from #302.
Replace shell operators (2>/dev/null, pipes, &&, ||) passed to run()
which uses execFileSync without a shell:

- sharpen-followup: use array args for diff/status calls
- checkpoint: split staging + commit into separate run() calls
- sequence-tasks: use array args for ls-files, slice in JS
- session-handoff: use execFileSync for 'which' and 'gh' directly

All calls now use proper array args or dedicated execFileSync.
Fixes part of #302.
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