MCPcopy
hub / github.com/meteor/meteor / parseServerOptionsForRunCommand

Function parseServerOptionsForRunCommand

tools/cli/commands.js:70–88  ·  view source on GitHub ↗
(options, runTargets)

Source from the content-addressed store, hash-verified

68// Utility functions to parse options in run/build/test-packages commands
69
70export 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
90function parsePortOption(portOption) {
91 let parsedServerUrl = utils.parseUrl(portOption);

Callers 3

cordova-run.jsFile · 0.90
doRunCommandFunction · 0.85
doTestCommandFunction · 0.85

Calls 4

parsePortOptionFunction · 0.85
parseMobileServerOptionFunction · 0.85
detectMobileServerUrlFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…