Skip to content

Commit 5a1f346

Browse files
authored
Merge pull request #21 from yogesh-aggarwal/fix/data-directory
fix: data directory creation by uncommenting mkdirSync in Codebase class
2 parents b9a805f + c7cdeaa commit 5a1f346

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ingestion/src/process/prepare/codebase.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ export class Codebase {
4040
}
4141

4242
private initializeDataDirectory(removeExisting = false): void {
43-
this._dataDirName = "data" || uuid()
43+
this._dataDirName = uuid()
4444
this._dataDirPath = path.resolve(this._path, this._dataDirName)
4545

4646
/* Handle data directory */
47-
if (removeExisting && existsSync(this._dataDirPath)) rmSync(this._dataDirPath, { recursive: true })
48-
// mkdirSync(this._dataDirPath)
47+
const exists = existsSync(this._dataDirPath)
48+
if (removeExisting && exists) rmSync(this._dataDirPath, { recursive: true })
49+
if (!exists) mkdirSync(this._dataDirPath)
4950
}
5051

5152
private prepareFilesMetadata() {

0 commit comments

Comments
 (0)