-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathsetup.mjs
More file actions
34 lines (28 loc) · 930 Bytes
/
setup.mjs
File metadata and controls
34 lines (28 loc) · 930 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
25
26
27
28
29
30
31
32
33
34
/* eslint-disable no-console */
import { promises as fs } from "fs";
import { join } from "path";
import { fileURLToPath } from "url";
import { execSync } from "child_process";
console.log("Installing all dependencies for fixtures...");
const __dirname = fileURLToPath(new URL(".", import.meta.url));
const fixturesDir = join(__dirname, "fixtures");
const entries = await fs.readdir(fixturesDir, { withFileTypes: true });
// Get all directories
const directories = entries
.filter((entry) => entry.isDirectory())
.map((entry) => join(fixturesDir, entry.name));
for (const dir of directories) {
try {
const packageJson = await fs.readFile(join(dir, "package.json"), { encoding: "utf-8" });
if (packageJson.length < 50) {
continue;
}
} catch {
continue;
}
execSync("pnpm install", {
cwd: dir,
stdio: "inherit",
});
}
console.log("All fixture dependencies installed successfully!");