shipthis 0.1.29 → 0.1.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import { Flags } from '@oclif/core';
3
3
  import { useInput, Box, Text, render } from 'ink';
4
- import { M as LogLevel, a2 as getShortAuthRequiredUrl, W as WEB_URL, c as BaseGameCommand, H as downloadBuildById } from '../../index-DxzXU9Hd.js';
4
+ import { M as LogLevel, a2 as getShortAuthRequiredUrl, W as WEB_URL, c as BaseGameCommand, E as getJob, H as downloadBuildById } from '../../index-DxzXU9Hd.js';
5
5
  import { useContext, useState, useEffect } from 'react';
6
6
  import { d as CommandContext, b as GameContext, M as Markdown } from '../../index-BTAL7EB_.js';
7
7
  import 'ink-spinner';
@@ -220,13 +220,20 @@ class GameShip extends BaseGameCommand {
220
220
  if (!gameId) {
221
221
  this.error("No game ID found");
222
222
  }
223
- const handleComplete = async ([job]) => {
223
+ const MAX_RETRIES = 3;
224
+ const RETRY_DELAY_MS = 5e3;
225
+ const handleComplete = async ([originalJob]) => {
224
226
  if (!this.flags.download && !this.flags.downloadAPK) return process.exit(0);
225
- const builds = job.builds ?? [];
226
- if (builds.length === 0) this.error("No builds found for this job");
227
+ let job = null;
228
+ for (let attempt = 1; attempt <= MAX_RETRIES; attempt++) {
229
+ job = await getJob(originalJob.id, gameId);
230
+ if (job.builds && job.builds.length > 0) break;
231
+ if (attempt < MAX_RETRIES) await new Promise((res) => setTimeout(res, RETRY_DELAY_MS));
232
+ }
233
+ if (!job?.builds || job.builds.length === 0) this.error("No builds found for this job after multiple attempts");
227
234
  const platform = this.flags.platform;
228
235
  const type = platform === "android" ? this.flags.downloadAPK ? "APK" : "AAB" : "IPA";
229
- const build = builds.find((b) => b.buildType === type);
236
+ const build = job.builds.find((b) => b.buildType === type);
230
237
  if (!build) this.error(`No build found for type ${type}`);
231
238
  const filename = this.flags.download || this.flags.downloadAPK;
232
239
  await downloadBuildById(gameId, build.id, `${filename}`);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "shipthis",
3
3
  "description": "ShipThis manages building and uploading your Godot games to the App Store and Google Play.",
4
- "version": "0.1.29",
4
+ "version": "0.1.30",
5
5
  "author": "Hello Invent Ltd",
6
6
  "bin": {
7
7
  "shipthis": "./bin/run.js"