MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / getRandomTempFolder

Function getRandomTempFolder

src/test/helpers.ts:1114–1123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1112}
1113
1114export function getRandomTempFolder(): string {
1115 const r = Math.floor(Math.random() * 100000);
1116 const base = path.join(tmpdir(), "dart-code-tests");
1117 if (!fs.existsSync(base))
1118 fs.mkdirSync(base);
1119 const tmpPath = path.join(base, r.toString());
1120 if (!fs.existsSync(tmpPath))
1121 fs.mkdirSync(tmpPath);
1122 return tmpPath;
1123}
1124
1125export function createTempPubPackage(packageName: string, folderName = "temp_package"): string {
1126 const tempFolder = getRandomTempFolder();

Callers 9

createExternalTestFileFunction · 0.90
fs.test.tsFile · 0.90
processes.test.tsFile · 0.90
autolaunch.test.tsFile · 0.90
createSdkRootFunction · 0.90
flutter.test.tsFile · 0.90
extension.test.tsFile · 0.90
createTempPubPackageFunction · 0.85

Calls 1

toStringMethod · 0.45

Tested by 3

createExternalTestFileFunction · 0.72
createSdkRootFunction · 0.72