UNPKG

shipthis

Version:

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

95 lines (92 loc) 3.28 kB
import { jsxs, jsx } from 'react/jsx-runtime'; import { Args, Flags } from '@oclif/core'; import { render } from 'ink'; import { c as BaseGameCommand, z as getJob, J as JobStatus } 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 'isomorphic-git'; import '@tanstack/react-query'; import 'react'; import 'fast-glob'; import 'uuid'; import 'yazl'; import 'socket.io-client'; import 'fullscreen-ink'; import { J as JobLogTail } from '../../../JobLogTail-D35FO5v-.js'; import { J as JobStatusTable } from '../../../JobStatusTable-DIJ_h-gi.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 'string-length'; import 'strip-ansi'; 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 '../../../index-CJWMt1s-.js'; import '../../../useAndroidServiceAccountTestResult-CwKeW0ED.js'; import '../../../useWebSocket-cM5yOcDv.js'; import '../../../Title-BCQtayg6.js'; import '../../../StatusTable-DzRWcMr4.js'; import 'fs'; import 'path'; class GameJobStatus extends BaseGameCommand { static args = { job_id: Args.string({ description: "The id of the job to get the status of", required: true }) }; static description = "Shows the real-time status of a job."; static examples = [ "<%= config.bin %> <%= command.id %> 4d32239e", "<%= config.bin %> <%= command.id %> --gameId 0c179fc4 4d32239e", "<%= config.bin %> <%= command.id %> --gameId 0c179fc4 --lines 20 --follow 4d32239e" ]; static flags = { ...super.flags, follow: Flags.boolean({ char: "f", default: false, description: "Follow the log in real-time" }), lines: Flags.integer({ char: "n", default: 10, description: "The number of lines to show" }) }; async getJob() { try { const game = await this.getGame(); const job = await getJob(this.args.job_id, game.id); return job; } catch (error) { if (error?.response?.status === 404) { this.error("Job not found - please check you have access", { exit: 1 }); } throw error; } } async run() { const job = await this.getJob(); const { follow, lines } = this.flags; const handleJobUpdate = (job2) => { if (!follow) return; if ([JobStatus.COMPLETED, JobStatus.FAILED].includes(job2.status)) { const exitCode = job2.status === JobStatus.FAILED ? 1 : 0; setTimeout(() => process.exit(exitCode), 5e3); } }; render( /* @__PURE__ */ jsxs(Command, { command: this, children: [ /* @__PURE__ */ jsx(JobStatusTable, { isWatching: follow, jobId: job.id, onJobUpdate: handleJobUpdate, projectId: job.project.id }), /* @__PURE__ */ jsx(JobLogTail, { isWatching: follow, jobId: job.id, length: lines, projectId: job.project.id }), /* @__PURE__ */ jsx(NextSteps, { steps: [] }) ] }) ); } } export { GameJobStatus as default };