Skip to content

Commit

Permalink
fix: remove tmp files
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyg603 committed Mar 20, 2024
1 parent 45feb50 commit d1e5e54
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions bin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,13 @@ import { CommandLineDefinition, argDefinitions, usageDefinitions } from './comma
}

await uploadSymbolFiles(bugsplat, database, application, version, directory, symbolFilePaths);

await safeRemoveTmp();
process.exit(0);
})().catch((error) => {
})().catch(async (error) => {
console.error(error.message);
process.exit(1);
}).finally(async () => {
await safeRemoveTmp();
})
process.exit(1);
});

async function createBugSplatClient({
user,
Expand Down
4 changes: 2 additions & 2 deletions src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ export class UploadWorker {
let tmpFileName = '';

if (dbgId && !isZip) {
tmpFileName = join(tmpDir, `${fileName}.gz`);
let tmpSubdir = join(tmpDir, dirname(fileName));
const tmpSubdir = join(tmpDir, dirname(fileName));
if (!existsSync(tmpSubdir)) {
mkdirSync(tmpSubdir, { recursive: true });
}
tmpFileName = join(tmpSubdir, `${fileName}.gz`);
client = this.symbolsClient;
await this.pool.exec('createGzipFile', [path, tmpFileName]);
} else if (!isZip) {
Expand Down

0 comments on commit d1e5e54

Please sign in to comment.