UNPKG

shipthis

Version:

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

82 lines (79 loc) 2.58 kB
import { jsx } from 'react/jsx-runtime'; import * as fs from 'node:fs'; import { Args, Flags } from '@oclif/core'; import { render } from 'ink'; import { L as downloadBuildById } from '../../../baseCommand-CTn3KGH3.js'; 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-spinner'; import 'string-length'; import 'strip-ansi'; import 'open'; import '@inkjs/ui'; import { c as BaseGameCommand } from '../../../baseGameCommand-8VL7xe-O.js'; import 'marked'; import 'marked-terminal'; import 'qrcode'; import { R as RunWithSpinner } from '../../../RunWithSpinner-DucRnFp6.js'; import { C as Command } from '../../../Command-Cj6F5B5a.js'; import 'crypto-js'; import '@expo/apple-utils/build/index.js'; import 'deepmerge'; import 'ini'; import 'fs'; import 'path'; 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 };