shipthis
Version:
ShipThis manages building and uploading your Godot games to the App Store and Google Play.
73 lines (70 loc) • 2.2 kB
JavaScript
import { Args, Flags } from '@oclif/core';
import { j as isCWDGodotGame, k as getProject, v as DEFAULT_SHIPPED_FILES_GLOBS, w as DEFAULT_IGNORED_FILES_GLOBS } from '../../baseCommand-CTn3KGH3.js';
import { B as BaseAuthenticatedCommand } from '../../baseGameCommand-8VL7xe-O.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';
import 'crypto-js';
import '@expo/apple-utils/build/index.js';
import 'deepmerge';
import 'ini';
import 'react/jsx-runtime';
import 'ink-spinner';
import 'string-length';
import 'strip-ansi';
import 'open';
import '@inkjs/ui';
import 'fs';
import 'path';
import 'marked';
import 'marked-terminal';
import 'qrcode';
class GameExport extends BaseAuthenticatedCommand {
static args = {
game_id: Args.string({ description: 'The ID of the game to export (use "list" to get the ID)', required: true })
};
static description = "Downloads the shipthis.json file for a given game into the current directory.";
static examples = [
"<%= config.bin %> <%= command.id %> abcd1234",
"<%= config.bin %> <%= command.id %> abcd1234 --force"
];
static flags = {
force: Flags.boolean({ char: "f" })
};
async run() {
const { args } = this;
if (!isCWDGodotGame()) {
return this.error("No Godot project detected. Please run this from a godot project directory.", { exit: 1 });
}
if (this.hasProjectConfig() && !this.flags.force) {
return this.error(
"This project has already been initialized. Use --force to overwrite the existing configuration.",
{ exit: 1 }
);
}
const project = await getProject(args.game_id);
await this.setProjectConfig({
ignoredFilesGlobs: DEFAULT_IGNORED_FILES_GLOBS,
project,
shippedFilesGlobs: DEFAULT_SHIPPED_FILES_GLOBS
});
await this.config.runCommand("game:status");
this.exit(0);
}
}
export { GameExport as default };