MCPcopy
hub / github.com/meteor/meteor / doRunCommand

Function doRunCommand

tools/cli/commands.js:331–448  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

329), doRunCommand);
330
331function doRunCommand(options) {
332 Console.setVerbose(!!options.verbose);
333
334 // Additional args are interpreted as run targets
335 const runTargets = parseRunTargets(options.args);
336
337 const { parsedServerUrl, parsedMobileServerUrl, parsedCordovaServerPort } =
338 parseServerOptionsForRunCommand(options, runTargets);
339
340 var includePackages = [];
341 if (options['extra-packages']) {
342 includePackages = options['extra-packages'].trim().split(/\s*,\s*/);
343 }
344
345 var projectContext = new projectContextModule.ProjectContext({
346 projectDir: options.appDir,
347 allowIncompatibleUpdate: options['allow-incompatible-update'],
348 lintAppAndLocalPackages: !options['no-lint'],
349 includePackages: includePackages,
350 });
351
352 main.captureAndExit("=> Errors while initializing project:", function () {
353 // We're just reading metadata here --- we'll wait to do the full build
354 // preparation until after we've started listening on the proxy, etc.
355 projectContext.readProjectMetadata();
356 });
357
358 if (release.explicit) {
359 if (release.current.name !== projectContext.releaseFile.fullReleaseName) {
360 console.log("=> Using %s as requested (overriding %s)",
361 release.current.getDisplayName(),
362 projectContext.releaseFile.displayReleaseName);
363 console.log();
364 }
365 }
366
367 let appHost, appPort;
368 if (options['app-port']) {
369 var appPortMatch = options['app-port'].match(/^(?:(.+):)?([0-9]+)?$/);
370 if (!appPortMatch) {
371 Console.error(
372 "run: --app-port must be a number or be of the form 'host:port' ",
373 "where port is a number. Try",
374 Console.command("'meteor help run'") + " for help.");
375 return 1;
376 }
377 appHost = appPortMatch[1] || null;
378 // It's legit to specify `--app-port host:` and still let the port be
379 // randomized.
380 appPort = appPortMatch[2] ? parseInt(appPortMatch[2]) : null;
381 }
382
383 if (options.production) {
384 Console.warn(
385 "Warning: The --production flag should only be used to simulate production " +
386 "bundling for testing purposes. Use meteor build to create a bundle for " +
387 "production deployment. See: https://guide.meteor.com/deployment.html"
388 );

Callers 1

commands.jsFile · 0.85

Calls 13

parseRunTargetsFunction · 0.85
prepareCordovaProjectFunction · 0.85
normalizeInspectOptionsFunction · 0.85
setVerboseMethod · 0.80
commandMethod · 0.80
warnMethod · 0.80
isEmptyMethod · 0.80
indexOfMethod · 0.80
matchMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…