MCPcopy Index your code
hub / github.com/browserless/browserless / waitForCommand

Function waitForCommand

src/sdk-utils.ts:16–32  ·  view source on GitHub ↗
(cmd: string, workingDirectory: string)

Source from the content-addressed store, hash-verified

14const execAsync = promisify(exec);
15
16const waitForCommand = async (cmd: string, workingDirectory: string) =>
17 execAsync(cmd, { cwd: workingDirectory })
18 .then(({ stderr }) => {
19 if (stderr) {
20 console.warn(
21 `Command produced the following stderr entries: \n${stderr}`,
22 );
23 }
24 return;
25 })
26 .catch((e) => {
27 console.error(
28 `Error running command: "${cmd}" at directory: "${workingDirectory}"`,
29 e,
30 );
31 process.exit(1);
32 });
33
34export const getArgSwitches = () => {
35 return process.argv.reduce(

Callers 4

installDependenciesFunction · 0.85
installBrowsersFunction · 0.85
buildDockerImageFunction · 0.85
buildTypeScriptFunction · 0.85

Calls 2

warnMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected