• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cameri / nostream / 24936061178

25 Apr 2026 05:05PM UTC coverage: 60.798% (-14.1%) from 74.929%
24936061178

Pull #574

github

web-flow
Merge 674e288ba into ddc811d6e
Pull Request #574: feat: migrate nostream scripts to unified CLI/TUI

1538 of 2872 branches covered (53.55%)

Branch coverage included in aggregate %.

711 of 1701 new or added lines in 29 files covered. (41.8%)

105 existing lines in 20 files now uncovered.

3673 of 5699 relevant lines covered (64.45%)

7.47 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

6.38
/src/cli/utils/process.ts
1
import { spawn } from 'child_process'
2✔
2

3
export type RunOptions = {
4
  cwd?: string
5
  env?: NodeJS.ProcessEnv
6
  stdio?: 'inherit' | 'pipe'
7
  timeoutMs?: number
8
}
9

10
export const runCommand = (command: string, args: string[], options: RunOptions = {}): Promise<number> => {
2!
NEW
11
  return new Promise((resolve, reject) => {
×
NEW
12
    const child = spawn(command, args, {
×
13
      cwd: options.cwd,
14
      env: { ...process.env, ...(options.env ?? {}) },
×
15
      stdio: options.stdio ?? 'inherit',
×
16
      shell: false,
17
    })
18

19
    const timer =
NEW
20
      typeof options.timeoutMs === 'number'
×
21
        ? setTimeout(() => {
NEW
22
            child.kill('SIGTERM')
×
23
          }, options.timeoutMs)
24
        : undefined
25

NEW
26
    child.on('error', reject)
×
NEW
27
    child.on('close', (code) => {
×
NEW
28
      if (timer) {
×
NEW
29
        clearTimeout(timer)
×
30
      }
31

NEW
32
      resolve(code ?? 1)
×
33
    })
34
  })
35
}
36

37
export const runCommandWithOutput = (
2✔
38
  command: string,
39
  args: string[],
40
  options: RunOptions = {},
×
41
): Promise<{ code: number; stdout: string; stderr: string }> => {
NEW
42
  return new Promise((resolve, reject) => {
×
NEW
43
    let stdout = ''
×
NEW
44
    let stderr = ''
×
45

NEW
46
    const child = spawn(command, args, {
×
47
      cwd: options.cwd,
48
      env: { ...process.env, ...(options.env ?? {}) },
×
49
      stdio: 'pipe',
50
      shell: false,
51
    })
52

53
    const timer =
NEW
54
      typeof options.timeoutMs === 'number'
×
55
        ? setTimeout(() => {
NEW
56
            child.kill('SIGTERM')
×
57
          }, options.timeoutMs)
58
        : undefined
59

NEW
60
    child.stdout.on('data', (chunk) => {
×
NEW
61
      stdout += chunk.toString()
×
62
    })
63

NEW
64
    child.stderr.on('data', (chunk) => {
×
NEW
65
      stderr += chunk.toString()
×
66
    })
67

NEW
68
    child.on('error', reject)
×
NEW
69
    child.on('close', (code) => {
×
NEW
70
      if (timer) {
×
NEW
71
        clearTimeout(timer)
×
72
      }
73

NEW
74
      resolve({
×
75
        code: code ?? 1,
×
76
        stdout,
77
        stderr,
78
      })
79
    })
80
  })
81
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc