UNPKG

shipthis

Version:

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

77 lines (74 loc) 2.6 kB
import { jsx } from 'react/jsx-runtime'; import { Flags } from '@oclif/core'; import { render } from 'ink'; import { M as getGoogleStatus, S as disconnectGoogle } from '../../../../baseCommand-CTn3KGH3.js'; import 'node:fs'; import 'node:path'; import 'chalk'; import 'node:crypto'; import 'node:readline'; import 'node:url'; import 'readline-sync'; import 'luxon'; import 'axios'; import 'isomorphic-git'; import '@tanstack/react-query'; import 'react'; import 'fast-glob'; import 'uuid'; import 'yazl'; import 'socket.io-client'; import 'fullscreen-ink'; import 'ink-spinner'; import 'string-length'; import 'strip-ansi'; import 'open'; import { C as ConnectGoogle } from '../../../../index-CuyVBHWc.js'; import '../../../../baseGameCommand-8VL7xe-O.js'; import '@inkjs/ui'; import 'marked'; import 'marked-terminal'; import 'qrcode'; import { C as CommandGame } from '../../../../CommandGame-CuvuH-z6.js'; import { B as BaseGameAndroidCommand } from '../../../../baseGameAndroidCommand-DRzVMKuG.js'; import 'crypto-js'; import '@expo/apple-utils/build/index.js'; import 'deepmerge'; import 'ini'; import '../../../../useGoogleStatus-WqPgHteE.js'; import '../../../../useWebSocket-MXDbQHcu.js'; import 'fs'; import 'path'; import '../../../../Command-Cj6F5B5a.js'; class GameAndroidApiKeyConnect extends BaseGameAndroidCommand { static args = {}; static description = "Connects ShipThis with Google for managing Service Account API Keys for an Android game"; static examples = [ "<%= config.bin %> <%= command.id %>", "<%= config.bin %> <%= command.id %> --force", "<%= config.bin %> <%= command.id %> --disconnect" ]; static flags = { ...BaseGameAndroidCommand.flags, disconnect: Flags.boolean({ char: "d" }), force: Flags.boolean({ char: "f" }) }; async run() { const googleStatus = await getGoogleStatus(); if (this.flags.disconnect) { if (!googleStatus.isAuthenticated && !this.flags.force) { throw new Error("You are not authenticated with Google. Use --force to disconnect anyway."); } await disconnectGoogle(); this.log("Disconnected from Google."); return; } if (googleStatus.isAuthenticated && !this.flags.force) { throw new Error("You are already authenticated with Google. Use --force to re-authenticate."); } render( /* @__PURE__ */ jsx(CommandGame, { command: this, children: /* @__PURE__ */ jsx(ConnectGoogle, { helpPage: !this.flags.force, onComplete: () => process.exit(0), onError: (e) => this.error(e) }) }) ); } } export { GameAndroidApiKeyConnect as default };