fs: Limit random tmp suffix to 8 digits
This commit is contained in:
parent
ce64f175c4
commit
954374861d
1 changed files with 1 additions and 1 deletions
|
@ -37,7 +37,7 @@ export async function exists(path: string) {
|
|||
|
||||
export async function withTempDir<Return>(callback: (tmp: TempState) => Promise<Return>) {
|
||||
let tmp = os.tmpdir()
|
||||
let rand = `${Math.random()}`.slice(2)
|
||||
let rand = `${Math.random()}`.slice(2, 10)
|
||||
let dir = `${tmp}/${TMP_PREFIX}${rand}`
|
||||
|
||||
await fs.rm(dir, { force: true, recursive: true })
|
||||
|
|
Loading…
Reference in a new issue