mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
14 lines
484 B
JavaScript
14 lines
484 B
JavaScript
const fs = require("node:fs");
|
|
const input = JSON.parse(fs.readFileSync("/dev/stdin", "utf8"));
|
|
const cmd = input.tool_input?.command || "";
|
|
|
|
const devPattern = /\b(pnpm|npm|yarn|bun)\s+(run\s+)?dev\b/;
|
|
|
|
if (devPattern.test(cmd) && !/tmux/.test(cmd) && !/&\s*$/.test(cmd)) {
|
|
console.log(
|
|
"TIP: Dev servers block the session. Consider running in tmux instead:\n" +
|
|
` tmux new-session -d -s stirling-dev '${cmd}'\n` +
|
|
"Or append & to background the process.",
|
|
);
|
|
}
|