Skip to content

Commit

Permalink
create dir before calling realpathSync
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed Dec 21, 2024
1 parent 045d7fe commit 8505527
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/temp-directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ import { removeDirectory } from './utils.js';

export async function create(context) {
if (context.options && context.options.tmpDir) {
context.path = join(realpathSync(context.options.tmpDir), randomUUID());
context.path = join(context.options.tmpDir, randomUUID());
} else {
context.path = join(realpathSync(tmpdir()), randomUUID());
context.path = join(tmpdir(), randomUUID());
}

await fs.mkdir(context.path, { recursive: true });
context.path = realpathSync(context.path);

context.emit(
'data',
'verbose',
Expand Down

0 comments on commit 8505527

Please sign in to comment.