refactor: migrated binary detection to $which() utility across codebase
- Replaced all Bun.which() calls with $which() utility from @oh-my-pi/pi-utils across 22 files. - Removed findBashOnPath() wrapper function from procmgr.ts, consolidating binary path resolution. - Updated AGENTS.md documentation to reflect new $which() API usage pattern. - Centralized binary detection logic through shared utility, reducing code duplication.
This commit is contained in:
@@ -339,7 +339,7 @@ const wrapped = Bun.wrapAnsi(text, width, {
|
||||
| File read/write | `Bun.file()`, `Bun.write()` | `readFileSync`, `writeFileSync` |
|
||||
| Spawn process | `$\`cmd\``, `Bun.spawn()` | `child_process` |
|
||||
| Sleep | `Bun.sleep(ms)` | `setTimeout` promise |
|
||||
| Binary lookup | `Bun.which("git")` | `spawnSync(["which", "git"])` |
|
||||
| Binary lookup | `$which("git")` from `@oh-my-pi/pi-utils` | `spawnSync(["which", "git"])` |
|
||||
| HTTP server | `Bun.serve()` | `http.createServer()` |
|
||||
| SQLite | `bun:sqlite` | `better-sqlite3` |
|
||||
| Hashing | `Bun.hash()`, Web Crypto | `node:crypto` |
|
||||
|
||||
Reference in New Issue
Block a user