MCPcopy Create free account
hub / github.com/firebase/firebase-tools / prepare

Method prepare

src/command.ts:313–386  ·  view source on GitHub ↗
(options: Options)

Source from the content-addressed store, hash-verified

311 */
312 // eslint-disable-next-line @typescript-eslint/no-explicit-any
313 public async prepare(options: Options): Promise<void> {
314 options = options || {};
315 options.project = getInheritedOption(options, "project");
316
317 if (
318 !process.stdin.isTTY ||
319 getInheritedOption(options, "nonInteractive") ||
320 getInheritedOption(options, "json") // --json implies --non-interactive.
321 ) {
322 options.nonInteractive = true;
323 }
324
325 // allow override of detected non-interactive with --interactive flag
326 if (getInheritedOption(options, "interactive")) {
327 options.nonInteractive = false;
328 }
329
330 if (getInheritedOption(options, "debug")) {
331 options.debug = true;
332 }
333
334 if (!getInheritedOption(options, "json") && !options.isMCP) {
335 useConsoleLoggers();
336 }
337
338 if (getInheritedOption(options, "config")) {
339 options.configPath = getInheritedOption(options, "config");
340 }
341
342 const onlyOption = getInheritedOption(options, "only");
343 if (onlyOption) {
344 // Handle cases where PowerShell replaces commas with spaces.
345 // see https://github.com/firebase/firebase-tools/issues/7506
346 options.only = onlyOption
347 .split(/[\s,]+/)
348 .filter(Boolean)
349 .join(",");
350 }
351
352 const exceptOption = getInheritedOption(options, "except");
353 if (exceptOption) {
354 // Handle cases where PowerShell replaces commas with spaces.
355 // see https://github.com/firebase/firebase-tools/issues/7506
356 options.except = exceptOption
357 .split(/[\s,]+/)
358 .filter(Boolean)
359 .join(",");
360 }
361
362 try {
363 options.config = Config.load(options);
364 } catch (e: any) {
365 options.configError = e;
366 }
367
368 const account = getInheritedOption(options, "account");
369 options.account = account;
370

Callers 4

runnerMethod · 0.95
prepare.spec.tsFile · 0.80
getDevModeHandleFunction · 0.80
resolveOptionsMethod · 0.80

Calls 9

applyRCMethod · 0.95
getInheritedOptionFunction · 0.90
useConsoleLoggersFunction · 0.90
detectProjectRootFunction · 0.90
selectAccountFunction · 0.90
setActiveAccountFunction · 0.90
validateProjectIdFunction · 0.85
loadMethod · 0.80

Tested by

no test coverage detected