UNPKG

shipthis

Version:

ShipThis manages building and uploading your Godot games to the App Store and Google Play.

77 lines (74 loc) 2.71 kB
import { jsx } from 'react/jsx-runtime'; import { Flags } from '@oclif/core'; import { render } from 'ink'; import 'node:fs'; import 'axios'; import 'crypto-js'; import 'uuid'; import { P as Platform, C as CredentialsType } from '../../../../baseCommand-CTn3KGH3.js'; import 'luxon'; import { a as getProjectCredentials } from '../../../../index-BW7z-5sB.js'; import 'node:path'; import 'chalk'; import 'node:crypto'; import 'node:readline'; import 'node:url'; import 'readline-sync'; import 'isomorphic-git'; import '@tanstack/react-query'; import 'react'; import 'fast-glob'; import 'yazl'; import 'socket.io-client'; import 'fullscreen-ink'; import 'ink-spinner'; import 'string-length'; import 'strip-ansi'; import 'open'; import '@inkjs/ui'; import '../../../../baseGameCommand-8VL7xe-O.js'; import 'marked'; import 'marked-terminal'; import 'qrcode'; import { C as CreateServiceAccountKey } from '../../../../index-cRnjcGxV.js'; import { C as CommandGame } from '../../../../CommandGame-CuvuH-z6.js'; import { B as BaseGameAndroidCommand } from '../../../../baseGameAndroidCommand-DRzVMKuG.js'; import '@expo/apple-utils/build/index.js'; import 'deepmerge'; import 'ini'; import 'fs'; import 'path'; import '../../../../useWebSocket-MXDbQHcu.js'; import '../../../../useProjectCredentials-TvlolkId.js'; import '../../../../useGoogleStatus-WqPgHteE.js'; import '../../../../ProgressSpinner-Um6ARKlk.js'; import '../../../../Command-Cj6F5B5a.js'; class GameAndroidApiKeyCreate extends BaseGameAndroidCommand { static args = {}; static description = "Creates a new Android Service Account API Key for a game"; static examples = [ "<%= config.bin %> <%= command.id %>", "<%= config.bin %> <%= command.id %> --gameId 0c179fc4" ]; static flags = { ...BaseGameAndroidCommand.flags, force: Flags.boolean({ char: "f" }), waitForAuth: Flags.boolean({ char: "w", description: "Wait for Google Authentication (10 mins)." }) }; async run() { const game = await this.getGame(); const { force, waitForAuth } = this.flags; this.checkGoogleAuth(waitForAuth); const projectCredentials = await getProjectCredentials(game.id); const hasApiKey = projectCredentials.some( (cred) => cred.platform === Platform.ANDROID && cred.isActive && cred.type === CredentialsType.KEY ); if (hasApiKey && !force) { this.error("An API Key is already set on this game. Use --force to overwrite it."); } render( /* @__PURE__ */ jsx(CommandGame, { command: this, children: /* @__PURE__ */ jsx(CreateServiceAccountKey, { onComplete: () => process.exit(0), onError: (e) => this.error(e) }) }) ); } } export { GameAndroidApiKeyCreate as default };