Skip to content

Commit 4153e4d

Browse files
authored
fix(fileRepository): create repositoryPath if not exists (#8909)
1 parent 78a5fc3 commit 4153e4d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/cubejs-backend-shared/src/FileRepository.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ export class FileRepository implements SchemaFileRepository {
2626
let files: string[] = [];
2727

2828
try {
29-
files = await fs.readdir(path.join(this.localPath(), dir));
29+
const fullPath = path.join(this.localPath(), dir);
30+
await fs.ensureDir(fullPath);
31+
files = await fs.readdir(fullPath);
3032
} catch (e) {
3133
throw new Error(`Model files not found. Please make sure the "${this.repositoryPath}" directory exists and contains model files.`);
3234
}

0 commit comments

Comments
 (0)