Skip to content

Commit 6df919e

Browse files
committed
Updated fetchProject to use storage.list instead of storage.listFilePaths.
1 parent 068e174 commit 6df919e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/storage/project.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,18 @@ export async function fetchProject(
6868
storage: commonStorage.Storage, projectName: string): Promise<Project> {
6969
await upgradeProjectIfNecessary(storage, projectName);
7070

71-
const modulePaths: string[] = await storage.listFilePaths(
72-
storageNames.makeModulePathRegexPattern(projectName));
71+
const projectFileNames: string[] = await storage.list(
72+
storageNames.makeProjectDirectoryPath(projectName));
7373

7474
let project: Project | null = null;
75-
const mechanisms: storageModule.Mechanism[] = []
75+
const mechanisms: storageModule.Mechanism[] = [];
7676
const opModes: storageModule.OpMode[] = [];
7777

78-
for (const modulePath of modulePaths) {
78+
for (const projectFileName of projectFileNames) {
79+
if (!storageNames.isValidModuleFileName(projectFileName)) {
80+
continue;
81+
}
82+
const modulePath = storageNames.makeFilePath(projectName, projectFileName);
7983
const moduleContentText = await storage.fetchFileContentText(modulePath);
8084
const moduleContent: storageModuleContent.ModuleContent =
8185
storageModuleContent.parseModuleContentText(moduleContentText);

0 commit comments

Comments
 (0)