Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
courtney-sims committed Oct 22, 2024
1 parent 62ce1c3 commit 7ff6d60
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/wranglerArtifactManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,26 @@ export async function getDetailedPagesDeployOutput(
const artifactFilePaths = await getWranglerArtifacts(artifactDirectory);

for (let i = 0; i < artifactFilePaths.length; i++) {
const file = await open(artifactFilePaths[i]);

for await (const line of file.readLines()) {
try {
const output = JSON.parse(line);
const parsedOutput = OutputEntryPagesDeployment.parse(output);
if (parsedOutput.type === "pages-deploy-detailed") {
// Assume, in the context of the action, the first detailed deploy instance seen will suffice
return parsedOutput;
const file = await open(artifactFilePaths[i], 'r');

for await (const line of file.readLines()) {

const output = JSON.parse(line);
const parsedOutput = OutputEntryPagesDeployment.parse(output);
if (parsedOutput.type === "pages-deploy-detailed") {
// Assume, in the context of the action, the first detailed deploy instance seen will suffice
return parsedOutput;
}
}

await file.close();
} catch (err) {
// If the line can't be parsed, skip it
// Many versions of wrangler may not have output files or pages-deploy-detailed output
// If we can't interact with an output file, just move on
continue;
}
}

await file.close();
}

return null;
Expand Down

0 comments on commit 7ff6d60

Please sign in to comment.