( sessionName: string, serviceName: string, env?: Record<string, string> )
| 108 | : buildStartCommand(serviceName, serviceNames); |
| 109 | const winIndex = createWindow(sessionName, serviceName, env, startupCommand); |
| 110 | setPaneServiceIdentity(sessionName, winIndex, 0, serviceName); |
| 111 | const logPath = path.join(findRepoRoot(), 'dev', 'logs', `${serviceName}.log`); |
| 112 | pipePane(sessionName, winIndex, 0, buildLogPipeCommand(logPath)); |
| 113 | } |
| 114 | |
| 115 | function buildInfraLogCommand(serviceName: string): string { |
| 116 | // Profile-gated services need --profile on every compose subcommand, |
| 117 | // including `logs`. Without it, Compose v2 filters the service out of |
| 118 | // the graph and the tmux pane is silent or errors. Shell-quote the |
| 119 | // profile and service names — they are safe identifiers today but the |
| 120 | // quoting keeps the command robust if a future maintainer adds a name |
| 121 | // containing whitespace or metacharacters. |
| 122 | const profile = getInfraProfile(serviceName); |
| 123 | const profileArg = profile ? `--profile ${shellQuote(profile)} ` : ''; |
| 124 | return `docker compose ${profileArg}-f dev/docker-compose.yml logs -f ${shellQuote(serviceName)}`; |
no test coverage detected