Skip to content

Commit

Permalink
feat: use date to create filename
Browse files Browse the repository at this point in the history
to avoid issues with randomInt()
  • Loading branch information
PeterSchafer committed Feb 8, 2023
1 parent 1c40a37 commit 0e9be6f
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 0e9be6f

Please sign in to comment.