(options, runTargets)
| 68 | // Utility functions to parse options in run/build/test-packages commands |
| 69 | |
| 70 | export function parseServerOptionsForRunCommand(options, runTargets) { |
| 71 | const parsedServerUrl = parsePortOption(options.port); |
| 72 | |
| 73 | // XXX COMPAT WITH 0.9.2.2 -- the 'mobile-port' option is deprecated |
| 74 | const mobileServerOption = options['mobile-server'] || options['mobile-port']; |
| 75 | let parsedMobileServerUrl; |
| 76 | if (mobileServerOption) { |
| 77 | parsedMobileServerUrl = parseMobileServerOption(mobileServerOption); |
| 78 | } else { |
| 79 | const isRunOnDeviceRequested = _.any(runTargets, |
| 80 | runTarget => runTarget.isDevice); |
| 81 | parsedMobileServerUrl = detectMobileServerUrl(parsedServerUrl, |
| 82 | isRunOnDeviceRequested); |
| 83 | } |
| 84 | |
| 85 | const parsedCordovaServerPort = parseCordovaServerPortOption(options); |
| 86 | |
| 87 | return { parsedServerUrl, parsedMobileServerUrl, parsedCordovaServerPort }; |
| 88 | } |
| 89 | |
| 90 | function parsePortOption(portOption) { |
| 91 | let parsedServerUrl = utils.parseUrl(portOption); |
no test coverage detected
searching dependent graphs…