( fullCommand, waitToFinish = true, label = 'executing' )
| 20 | * the runs the command. |
| 21 | */ |
| 22 | const 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 | |
| 55 | const isWindows = () => os.platform() === 'win32' |
| 56 | const isUrl = (s) => /^https?:\/\//.test(s) |
no outgoing calls
no test coverage detected