Skip to content

Commit

Permalink
Merge pull request #4393 from snyk/feat/HEAD-57_improve_tmp_file_hand…
Browse files Browse the repository at this point in the history
…ling

feat: use date to create filename
  • Loading branch information
PeterSchafer authored Feb 8, 2023
2 parents 1c40a37 + 0e9be6f commit 7e845a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ts-binary-wrapper/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as os from 'os';
import * as fs from 'fs';
import { spawnSync } from 'child_process';
import * as https from 'https';
import { randomInt, createHash } from 'crypto';
import { createHash } from 'crypto';

export const versionFile = path.join(__dirname, 'generated', 'version');
export const shasumFile = path.join(__dirname, 'generated', 'sha256sums.txt');
Expand Down Expand Up @@ -198,7 +198,7 @@ export function downloadExecutable(
): Promise<number> {
return new Promise<number>(function(resolve) {
const options = new URL(downloadUrl);
const temp = path.join(__dirname, randomInt(100000).toString());
const temp = path.join(__dirname, Date.now().toString());
const fileStream = fs.createWriteStream(temp);

const cleanupAfterError = (exitCode: number) => {
Expand Down

0 comments on commit 7e845a5

Please sign in to comment.