UNPKG

shipthis

Version:

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

116 lines (113 loc) 3.98 kB
import { jsx } from 'react/jsx-runtime'; import { Flags } from '@oclif/core'; import { render } from 'ink'; import { c as BaseGameCommand, D as DetailsFlags, s as GameEngine } from '../../index-BwnzoldS.js'; import 'ink-spinner'; import { i as isValidSemVer } from '../../index-CJWMt1s-.js'; import 'react'; import 'node:fs'; import 'axios'; import 'crypto-js'; import 'uuid'; import 'luxon'; import '@tanstack/react-query'; import 'fast-glob'; import 'yazl'; import 'socket.io-client'; import 'fullscreen-ink'; import 'string-length'; import 'strip-ansi'; import { S as StatusTable } from '../../StatusTable-DzRWcMr4.js'; import 'open'; import '@inkjs/ui'; import 'node:path'; import '../../ejs-DirFZbza.js'; import 'marked'; import 'marked-terminal'; import 'qrcode'; import '../../index-hoHfGrjg.js'; import { C as Command } from '../../Command-DN1j3tjt.js'; import '@expo/apple-utils/build/index.js'; import 'node:crypto'; import 'node:readline'; import 'node:url'; import 'readline-sync'; import 'isomorphic-git'; import 'deepmerge'; import 'ini'; import '../../Title-BCQtayg6.js'; import 'fs'; import 'path'; import '../../useAndroidServiceAccountTestResult-CwKeW0ED.js'; class GameDetails extends BaseGameCommand { static args = {}; static description = "Shows and sets the details of a game."; static examples = [ "<%= config.bin %> <%= command.id %>", "<%= config.bin %> <%= command.id %> --gameId 0c179fc4", "<%= config.bin %> <%= command.id %> --buildNumber 5 --semanticVersion 1.2.3", "<%= config.bin %> <%= command.id %> --gameEngine godot --gameEngineVersion 4.2 --force" ]; static flags = { ...BaseGameCommand.flags, force: Flags.boolean({ char: "f", description: "Force the command to run" }), ...DetailsFlags }; async run() { const { force, gameId, ...valueFlags } = this.flags; const { androidPackageName, buildNumber, gameEngine, gameEngineVersion, gcpProjectId, gcpServiceAccountId, iosBundleId, name, semanticVersion } = valueFlags; if (semanticVersion && !isValidSemVer(semanticVersion)) throw new Error(`Invalid semantic version: ${semanticVersion}`); if ((gameEngine || gameEngineVersion || iosBundleId || androidPackageName) && !force) throw new Error("Use --force to set the restricted fields"); if (gameEngine && gameEngine !== GameEngine.GODOT) throw new Error(`Game engine ${gameEngine} not supported`); let game = await this.getGame(); const update = { details: { ...game.details, ...semanticVersion && { semanticVersion }, ...buildNumber && { buildNumber }, ...gameEngine && { gameEngine }, ...gameEngineVersion && { gameEngineVersion }, ...iosBundleId && { iosBundleId }, ...androidPackageName && { androidPackageName }, ...gcpProjectId && { gcpProjectId }, ...gcpServiceAccountId && { gcpServiceAccountId } }, name: name || game.name }; if (Object.keys(valueFlags).length > 0) { game = await this.updateGame(update); } render( /* @__PURE__ */ jsx(Command, { command: this, children: /* @__PURE__ */ jsx( StatusTable, { statuses: { "Android Package Name": game.details?.androidPackageName || "N/A", "Build Number": game.details?.buildNumber || 1, "GCP Project ID": game.details?.gcpProjectId || "N/A", "GCP Service Account ID": game.details?.gcpServiceAccountId || "N/A", "Game Engine": game.details?.gameEngine || "Please set!", "Game Engine Version": game.details?.gameEngineVersion || "Please set!", "Game Name": game.name, "Semantic Version": game.details?.semanticVersion || "0.0.1", "iOS Bundle ID": game.details?.iosBundleId || "N/A" }, title: "Game Details" } ) }) ); } } export { GameDetails as default };