Skip to content

Commit c0d46b8

Browse files
committed
fix: ignore non-directory registry entries
1 parent 315d476 commit c0d46b8

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

apps/cli/src/cli.mjs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,16 @@ async function getModuleInstallFiles(name, visited = new Set()) {
209209
async function validateRegistry() {
210210
const registry = await readJson(path.join(repoRoot, "registry.json"));
211211
const itemNames = new Set();
212-
const moduleDirs = (await readdir(modulesRoot)).map((name) => path.join(modulesRoot, name));
212+
const moduleDirs = [];
213213
const errors = [];
214214

215+
for (const name of await readdir(modulesRoot)) {
216+
const fullPath = path.join(modulesRoot, name);
217+
if ((await stat(fullPath)).isDirectory()) {
218+
moduleDirs.push(fullPath);
219+
}
220+
}
221+
215222
for (const item of registry.items ?? []) {
216223
if (itemNames.has(item.name)) errors.push(`registry.json: duplicate item ${item.name}`);
217224
itemNames.add(item.name);
@@ -272,7 +279,12 @@ async function validateRegistry() {
272279
}
273280

274281
async function listModules() {
275-
const names = await readdir(modulesRoot);
282+
const names = [];
283+
for (const name of await readdir(modulesRoot)) {
284+
if ((await stat(path.join(modulesRoot, name))).isDirectory()) {
285+
names.push(name);
286+
}
287+
}
276288
for (const name of names.sort()) {
277289
const { manifest } = await getModule(name);
278290
console.log(`${manifest.name.padEnd(18)} ${manifest.status.padEnd(12)} ${manifest.description}`);

0 commit comments

Comments
 (0)