UNPKG

shipthis

Version:

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

79 lines (76 loc) 2.64 kB
import { jsxs, jsx } from 'react/jsx-runtime'; import { render } from 'ink'; import { Y as BaseCommand, j as isCWDGodotGame } from '../index-BwnzoldS.js'; import 'ink-spinner'; import 'node:crypto'; import 'node:fs'; import 'node:path'; import 'node:readline'; import 'node:url'; import 'readline-sync'; import 'luxon'; import 'axios'; import { i as isCWDGitRepo } from '../git-BpsfNFZ_.js'; import '@oclif/core'; import '@tanstack/react-query'; import 'react'; import 'crypto-js'; import 'uuid'; 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 '../ejs-DirFZbza.js'; import 'marked'; import 'marked-terminal'; import { N as NextSteps } from '../NextSteps-DbJHmscQ.js'; import 'qrcode'; import '../index-hoHfGrjg.js'; import { C as Command } from '../Command-DN1j3tjt.js'; import '@expo/apple-utils/build/index.js'; import 'isomorphic-git'; import 'deepmerge'; import 'ini'; import '../Title-BCQtayg6.js'; import 'fs'; import 'path'; import '../index-CJWMt1s-.js'; import '../useAndroidServiceAccountTestResult-CwKeW0ED.js'; class Status extends BaseCommand { static args = {}; static description = "Displays the current overall status."; static examples = ["<%= config.bin %> <%= command.id %>"]; static flags = {}; async run() { const authConfig = await this.getAuthConfig(); const isLoggedIn = Boolean(authConfig.shipThisUser); const isGodotGame = isCWDGodotGame(); const isShipThisConfigured = await this.hasProjectConfig(); const isGitRepo = await isCWDGitRepo(); let steps = []; if (!isLoggedIn) steps.push("shipthis login --email my.email@address.nowhere"); if (!isGodotGame) steps.push("Run this command in a Godot project directory"); if (!isShipThisConfigured) steps.push("shipthis game wizard"); const exitCode = steps.length > 0 ? 1 : 0; if (steps.length === 0) steps = ["shipthis game status"]; const statuses = {}; statuses["Logged in"] = isLoggedIn; statuses["Godot project detected"] = isGodotGame; statuses["ShipThis project configured"] = isShipThisConfigured; statuses["Git repository detected (not required)"] = isGitRepo; const statusProps = { statuses, title: "Status" }; render( /* @__PURE__ */ jsxs(Command, { command: this, children: [ /* @__PURE__ */ jsx(StatusTable, { ...statusProps }), /* @__PURE__ */ jsx(NextSteps, { steps }) ] }) ); return process.exit(exitCode); } } export { Status as default };