Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unique filename for temporary script files #95

Merged
merged 1 commit into from
Jul 12, 2022
Merged

fix: unique filename for temporary script files #95

merged 1 commit into from
Jul 12, 2022

Conversation

jlarmstrongiv
Copy link
Contributor

Use unique filenames for temporary script files to avoid npm throwing text file busy errors

Switch from Date.now() to crypto.randomBytes(4).toString('hex')

References

Fixes #91
Closes #91

Code References

const fileName = escape.filename(`${event}-${Date.now()}`)

https://github.com/npm/cli/blob/9d6f3f9c410753bf9412ddfeac6a000feccd14f0/lib/npm.js#L447-L448

@jlarmstrongiv jlarmstrongiv requested a review from a team as a code owner July 12, 2022 09:12
@jlarmstrongiv
Copy link
Contributor Author

@nlf whoops, didn’t mean to open another pull request. Resolves suggestions #92 (review)

@nlf nlf merged commit 9f93025 into npm:main Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] BREAKING REGRESSION npm concurrency regression in 4.1.0 and onwards
2 participants