shipthis
Version:
ShipThis manages building and uploading your Godot games to the App Store and Google Play.
78 lines (75 loc) • 2.66 kB
JavaScript
import { jsxs, jsx } from 'react/jsx-runtime';
import { render } from 'ink';
import 'node:fs';
import 'axios';
import 'crypto-js';
import 'uuid';
import { B as BaseCommand, j as isCWDGodotGame } from '../baseCommand-CTn3KGH3.js';
import 'luxon';
import 'ink-spinner';
import 'node:crypto';
import 'node:path';
import 'node:readline';
import 'node:url';
import 'readline-sync';
import { i as isCWDGitRepo } from '../git-BpsfNFZ_.js';
import '@oclif/core';
import '@tanstack/react-query';
import 'react';
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 '../baseGameCommand-8VL7xe-O.js';
import 'marked';
import 'marked-terminal';
import { N as NextSteps } from '../NextSteps-DbJHmscQ.js';
import 'qrcode';
import { C as Command } from '../Command-Cj6F5B5a.js';
import chalk from 'chalk';
import '@expo/apple-utils/build/index.js';
import 'isomorphic-git';
import 'deepmerge';
import 'ini';
import '../Title-BCQtayg6.js';
import 'fs';
import 'path';
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 email = authConfig.shipThisUser?.email;
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[email ? `Logged in ${chalk.bold(email)}` : "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 };