shipthis
Version:
ShipThis manages building and uploading your Godot games to the App Store and Google Play.
84 lines (81 loc) • 2.68 kB
JavaScript
import { jsx } from 'react/jsx-runtime';
import * as fs from 'node:fs';
import { Args, Flags } from '@oclif/core';
import { render } from 'ink';
import { c as BaseGameCommand, H as downloadBuildById } from '../../../index-BwnzoldS.js';
import 'ink-spinner';
import 'node:crypto';
import 'node:path';
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 'string-length';
import 'strip-ansi';
import 'open';
import '@inkjs/ui';
import '../../../ejs-DirFZbza.js';
import 'marked';
import 'marked-terminal';
import 'qrcode';
import { R as RunWithSpinner } from '../../../RunWithSpinner-DucRnFp6.js';
import '../../../index-hoHfGrjg.js';
import { C as Command } from '../../../Command-DN1j3tjt.js';
import 'crypto-js';
import '@expo/apple-utils/build/index.js';
import 'deepmerge';
import 'ini';
import 'fs';
import 'path';
import '../../../index-CJWMt1s-.js';
import '../../../useAndroidServiceAccountTestResult-CwKeW0ED.js';
class GameBuildDownload extends BaseGameCommand {
static args = {
build_id: Args.string({ description: "The ID of the build to download", required: true }),
file: Args.string({ description: "Name of the file to output", required: true })
};
static description = "Downloads the given build artifact to the specified file";
static examples = [
"<%= config.bin %> <%= command.id %> 7a3f5c92 output.ipa",
"<%= config.bin %> <%= command.id %> --gameId 0c179fc4 e4b9a3d7 output.apk"
];
static flags = {
...BaseGameCommand.flags,
force: Flags.boolean({ char: "f", description: "Overwrite the file if it already exists" })
};
async run() {
const { args, flags } = this;
const { build_id, file } = args;
const { force } = flags;
const alreadyExists = fs.existsSync(file);
if (alreadyExists && !force) {
this.error(`The file ${file} already exists. Use --force to overwrite it.`);
}
const executeMethod = async () => {
const game = await this.getGame();
await downloadBuildById(game.id, build_id, file);
};
const handleComplete = async () => process.exit(0);
render(
/* @__PURE__ */ jsx(Command, { command: this, children: /* @__PURE__ */ jsx(
RunWithSpinner,
{
executeMethod,
msgComplete: `Downloaded build artifact to ${file}`,
msgInProgress: `Downloading to ${file}...`,
onComplete: handleComplete
}
) })
);
}
}
export { GameBuildDownload as default };