UNPKG

shipthis

Version:

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

120 lines (117 loc) 4.31 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 { D as DetailsFlags, s as GameEngine } from '../../baseCommand-CTn3KGH3.js'; import 'luxon'; import 'node:path'; import 'chalk'; import { c as BaseGameCommand, l as isValidSemVer } from '../../baseGameCommand-8VL7xe-O.js'; import 'ink-spinner'; import 'react'; 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 'marked'; import 'marked-terminal'; import 'qrcode'; import { C as Command } from '../../Command-Cj6F5B5a.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 'fs'; import 'path'; import '../../Title-BCQtayg6.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, liquidGlassIconPath, name, semanticVersion, useDemoCredentials } = 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, ...androidPackageName && { androidPackageName }, ...buildNumber && { buildNumber }, ...gameEngine && { gameEngine }, ...gameEngineVersion && { gameEngineVersion }, ...gcpProjectId !== void 0 && { gcpProjectId }, ...gcpServiceAccountId !== void 0 && { gcpServiceAccountId }, ...iosBundleId && { iosBundleId }, ...liquidGlassIconPath !== void 0 && { liquidGlassIconPath }, ...semanticVersion && { semanticVersion }, ...useDemoCredentials !== void 0 && { useDemoCredentials: useDemoCredentials.toLowerCase() === "true" } }, 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", "Using Demo Credentials": game.details?.useDemoCredentials ? "Yes" : "No", "Liquid Glass Icon Path": game.details?.liquidGlassIconPath || "N/A" }, title: "Game Details" } ) }) ); } } export { GameDetails as default };