MCPcopy Create free account
hub / github.com/TestSprite/testsprite-cli / freshTmpDir

Function freshTmpDir

src/lib/bundle.ts:487–492  ·  view source on GitHub ↗

* Make a fresh ` /.tmp/` directory, removing any pre-existing * orphaned tmp from a prior aborted run. Using `mkdtemp` would dodge * the rm step but would make the rename target unpredictable; this * way the temp path is stable (` /.tmp`) so a SIGKILL between two * runs doesn't leave a t

(dir: string)

Source from the content-addressed store, hash-verified

485 * runs doesn't leave a tree of `.tmp.<rand>` directories.
486 */
487async function freshTmpDir(dir: string): Promise<string> {
488 const tmpDir = join(dir, '.tmp');
489 await rm(tmpDir, { recursive: true, force: true });
490 await mkdir(tmpDir, { recursive: true });
491 return tmpDir;
492}
493
494/**
495 * Rename `<tmp>/<file>` → `<dir>/<file>` for every file in `files`.

Callers 1

writeBundleFunction · 0.70

Calls 1

mkdirFunction · 0.50

Tested by

no test coverage detected