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

electron / fiddle / 22096527095

17 Feb 2026 11:22AM UTC coverage: 79.468% (-0.07%) from 79.539%
22096527095

push

github

web-flow
fix: don't concatenate args in `addModules` (#1853)

fix: don't concatenate args in addModules

1596 of 1736 branches covered (91.94%)

Branch coverage included in aggregate %.

10 of 22 new or added lines in 2 files covered. (45.45%)

9199 of 11848 relevant lines covered (77.64%)

32.03 hits per line

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

73.91
/src/main/utils/exec.ts
1
import { exec as cp_exec, execFile as cp_execFile } from 'node:child_process';
2✔
2
import { promisify } from 'node:util';
2✔
3

4
import shellEnv from 'shell-env';
2✔
5

6
/**
7
 * On macOS & Linux, we need to fix the $PATH environment variable
8
 * so that we can call `npm`.
9
 */
10
export const maybeFixPath = (() => {
2✔
11
  // Singleton: We don't want to do this more than once.
12
  let _shellPathCalled = false;
6✔
13

14
  return async (): Promise<void> => {
6✔
15
    if (_shellPathCalled) {
6✔
16
      return;
2✔
17
    }
2✔
18

19
    if (process.platform !== 'win32') {
6✔
20
      const { PATH } = await shellEnv();
3✔
21
      if (PATH) {
3✔
22
        process.env.PATH = PATH;
3✔
23
      }
3✔
24
    }
3✔
25

26
    _shellPathCalled = true;
4✔
27
  };
6✔
28
})();
2✔
29

30
/**
31
 * Execute a command in a directory.
32
 */
33
export async function exec(dir: string, cliArgs: string): Promise<string> {
3✔
34
  await maybeFixPath();
3✔
35

36
  const { stdout } = await promisify(cp_exec)(cliArgs, {
3✔
37
    cwd: dir,
3✔
38
    maxBuffer: 200 * 1024 * 100, // 100 times the default
3✔
39
  });
3✔
40

41
  return stdout.trim();
2✔
42
}
2✔
43

44
/**
45
 * Execute a command with arguments in a directory.
46
 */
NEW
47
export async function execFile(
×
NEW
48
  dir: string,
×
NEW
49
  cmd: string,
×
NEW
50
  args: Array<string>,
×
NEW
51
): Promise<string> {
×
NEW
52
  await maybeFixPath();
×
53

NEW
54
  const { stdout } = await promisify(cp_execFile)(cmd, args, {
×
NEW
55
    cwd: dir,
×
NEW
56
    maxBuffer: 200 * 1024 * 100,
×
NEW
57
  });
×
58

NEW
59
  return stdout.trim();
×
NEW
60
}
×
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