MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / expandWorkspacePattern

Function expandWorkspacePattern

scripts/release-set-version.mjs:36–55  ·  view source on GitHub ↗
(pattern)

Source from the content-addressed store, hash-verified

34}
35
36function expandWorkspacePattern(pattern) {
37 // Supports the small set of workspace patterns used in this repo:
38 // - explicit paths (packages/core)
39 // - one-level globs (examples/*)
40 if (!pattern.includes("*")) return [pattern];
41
42 const star = pattern.indexOf("*");
43 const base = pattern.slice(0, star);
44 const baseDir = resolve(ROOT, base);
45 if (!isDir(baseDir)) return [];
46
47 const out = [];
48 const entries = readdirSync(baseDir).slice().sort();
49 for (const name of entries) {
50 const full = join(baseDir, name);
51 if (!isDir(full)) continue;
52 out.push(join(base, name));
53 }
54 return out;
55}
56
57function listWorkspaceDirs() {
58 const rootPkg = readJson(join(ROOT, "package.json"));

Callers 1

listWorkspaceDirsFunction · 0.85

Calls 3

resolveFunction · 0.85
isDirFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected