History

Address PR review feedback for git actions

Julius Marminge committed 9 months ago

Commit 533dbdf1 parent 98eb87f6 files · +135 −21Browse files

Showing the changes to apps/server/src/codexTextGenerator.ts (1 of 6 files). Show all

Unified · Split

apps/server/src/codexTextGenerator.ts+7−2
@@ -117,9 +117,11 @@ async function runCodexJson<T>({ · 116 unmodified lines
117117 "codex-schema",
118118 JSON.stringify(outputSchemaJson),
119119 );
120− const outputPath = await writeTempFile("codex-output", "");
120+ let outputPath: string | null = null;
121121
122122 try {
123+ outputPath = await writeTempFile("codex-output", "");
124+
123125 await runProcess(
124126 "codex",
125127 [
@@ -154,7 +156,10 @@ async function runCodexJson<T>({ · 28 unmodified lines
154156
155157 return parse(parsedJson);
156158 } finally {
157− await Promise.all([safeUnlink(schemaPath), safeUnlink(outputPath)]);
159+ await Promise.all([
160+ safeUnlink(schemaPath),
161+ ...(outputPath ? [safeUnlink(outputPath)] : []),
162+ ]);
158163 }
159164 }
160165