MCPcopy Create free account
hub / github.com/cypress-io/github-action / execCommand

Function execCommand

index.js:22–53  ·  view source on GitHub ↗
(
  fullCommand,
  waitToFinish = true,
  label = 'executing'
)

Source from the content-addressed store, hash-verified

20 * the runs the command.
21 */
22const execCommand = (
23 fullCommand,
24 waitToFinish = true,
25 label = 'executing'
26) => {
27 const cwd = cypressCommandOptions.cwd
28
29 console.log('%s command "%s"', label, fullCommand)
30 console.log('current working directory "%s"', cwd)
31
32 const args = cliParser.parse(fullCommand)
33 debug(`parsed command: ${args.join(' ')}`)
34
35 return io.which(args[0], true).then((toolPath) => {
36 debug(`found command "${toolPath}"`)
37 debug(`with arguments ${args.slice(1).join(' ')}`)
38
39 const toolArguments = args.slice(1)
40 const argsString = toolArguments.join(' ')
41 debug(`running ${quote(toolPath)} ${argsString} in ${cwd}`)
42 debug(`waiting for the command to finish? ${waitToFinish}`)
43
44 const promise = exec.exec(
45 quote(toolPath),
46 toolArguments,
47 cypressCommandOptions
48 )
49 if (waitToFinish) {
50 return promise
51 }
52 })
53}
54
55const isWindows = () => os.platform() === 'win32'
56const isUrl = (s) => /^https?:\/\//.test(s)

Callers 5

installFunction · 0.85
buildAppMaybeFunction · 0.85
startServersMaybeFunction · 0.85
waitOnMaybeFunction · 0.85
runTestsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected