-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathsetup.js
More file actions
24 lines (20 loc) · 756 Bytes
/
Copy pathsetup.js
File metadata and controls
24 lines (20 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { readdir } from "node:fs/promises";
import { $ } from "bun";
const BENCHMARKS_DIR = `${import.meta.dir}/benchmarks`;
const benchmarks = (await readdir(BENCHMARKS_DIR, { withFileTypes: true }))
.filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent.name);
for (const benchmark of benchmarks) {
const cwd = `${BENCHMARKS_DIR}/${benchmark}`;
if (process.env.CI) {
await $`bun install --frozen-lockfile --cwd ${cwd}`;
} else {
await $`bun install --cwd ${cwd}`;
}
const testsDir = `${cwd}/tests`;
for (let i = 1; i <= 10; i++) {
const replicaDir = `${testsDir}/replica${i}`;
await $`rm -rf ${replicaDir}`;
await $`cp -r ${testsDir}/original ${replicaDir}`;
}
}