(id: string | undefined, options: StoreSetupOptions = {})
| 515 | |
| 516 | class StoreCommand { |
| 517 | async setup(id: string | undefined, options: StoreSetupOptions = {}): Promise<void> { |
| 518 | try { |
| 519 | const setupInput = await resolveSetupInput(id, options); |
| 520 | const prepared = await prepareSetupInput(setupInput, options); |
| 521 | const initGit = resolveSetupGitEnabled(prepared, options.initGit); |
| 522 | if (!options.json && isInteractive()) { |
| 523 | await confirmSetup(prepared, initGit); |
| 524 | } |
| 525 | const result = await setupPreparedStore(prepared, { initGit }); |
| 526 | const payload = toMutationOutput(result); |
| 527 | |
| 528 | if (options.json) { |
| 529 | printJson(payload); |
| 530 | return; |
| 531 | } |
| 532 | |
| 533 | printMutationHuman('Store ready', payload, result.remotes); |
| 534 | } catch (error) { |
| 535 | this.handleFailure( |
| 536 | options.json, |
| 537 | { store: null, registry: null, git: null, created_files: [], status: [] }, |
| 538 | error |
| 539 | ); |
| 540 | } |
| 541 | } |
| 542 | |
| 543 | async register(inputPath: string | undefined, options: StoreRegisterOptions = {}): Promise<void> { |
| 544 | try { |
no test coverage detected