Skip to content

Commit

Permalink
Remove unneeded variables (#11)
Browse files Browse the repository at this point in the history
* Remove unneeded variable isBuildComplete

* removed more unused variables

* Added a changeset
  • Loading branch information
WyattMufson authored Jan 9, 2025
1 parent 2f2d9b8 commit 06887d0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 31 deletions.
5 changes: 5 additions & 0 deletions .changeset/healthy-snails-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'build-uploader': patch
---

Removed unused variables from API calls
1 change: 0 additions & 1 deletion src/createBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export async function createBuild({
body.append('windowsChunkTotal', windowsChunkTotal.toString());
body.append('macChunkTotal', macChunkTotal.toString());
body.append('chunkNumber', '0');
body.append('isBuildComplete', 'false');
if (windowsGameName) {
body.append('windowsGameName', windowsGameName);
}
Expand Down
8 changes: 0 additions & 8 deletions src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ export async function run() {
gameId,
platform: 'windows',
filePath: windowsBuildPath,
windowsChunkTotal,
macChunkTotal,
buildId,
windowsGameName,
macGameName,
});
}

Expand All @@ -67,11 +63,7 @@ export async function run() {
gameId,
platform: 'mac',
filePath: macosBuildPath,
windowsChunkTotal,
macChunkTotal,
buildId,
windowsGameName,
macGameName,
});
}

Expand Down
22 changes: 0 additions & 22 deletions src/uploadBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,14 @@ export async function uploadBuild({
gameId,
platform,
filePath,
windowsChunkTotal,
macChunkTotal,
buildId,
windowsGameName,
macGameName,
}: {
apiKey: string;
apiBaseUrl: string;
gameId: string;
platform: 'windows' | 'mac';
filePath: string;
windowsChunkTotal: number;
macChunkTotal: number;
buildId: string;
windowsGameName: string | null;
macGameName: string | null;
}) {
try {
core.info(`Starting ${platform} build upload with file: ${filePath}`);
Expand All @@ -45,24 +37,10 @@ export async function uploadBuild({
core.info(`Read ${bytesRead} bytes for chunk ${i + 1}`);

const body = new FormData();
body.append('windowsChunkTotal', windowsChunkTotal.toString());
body.append('macChunkTotal', macChunkTotal.toString());
body.append('chunkNumber', (i + 1).toString());
body.append('platform', platform);
body.append('buildId', buildId);
body.append('isBuildComplete', 'false');
body.append('buildChunk', new Blob([buffer.subarray(0, bytesRead)]));
if (windowsGameName) {
body.append('windowsGameName', windowsGameName);
}
if (macGameName) {
body.append('macGameName', macGameName);
}
if (!windowsGameName && !macGameName) {
throw new Error(
'Either windowsGameName or macGameName must be provided'
);
}

const chunkResponse = await fetch(
`${apiBaseUrl}/v3/dashboard/games/${gameId}/builds`,
Expand Down

0 comments on commit 06887d0

Please sign in to comment.