Skip to content

Commit

Permalink
fix: unique filename for temporary script files (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlarmstrongiv committed Jul 12, 2022
1 parent d510209 commit 9f93025
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/make-spawn-args.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const { isAbsolute, resolve } = require('path')
const which = require('which')
const npm_config_node_gyp = require.resolve('node-gyp/bin/node-gyp.js')
const escape = require('./escape.js')
const { randomBytes } = require('crypto')

const makeSpawnArgs = options => {
const {
Expand All @@ -30,7 +31,7 @@ const makeSpawnArgs = options => {
npm_config_node_gyp,
})

const fileName = escape.filename(`${event}-${Date.now()}`)
const fileName = escape.filename(`${event}-${randomBytes(4).toString('hex')}`)
let scriptFile
let script = ''

Expand Down

0 comments on commit 9f93025

Please sign in to comment.