bug fix
This commit is contained in:
@@ -28,3 +28,4 @@ yarn-error.log*
|
|||||||
/dist/
|
/dist/
|
||||||
.idea
|
.idea
|
||||||
build
|
build
|
||||||
|
.pnpm-store/
|
||||||
|
|||||||
Generated
+2341
File diff suppressed because it is too large
Load Diff
@@ -48,6 +48,8 @@ export class HashIndexManager {
|
|||||||
public async init(autosave = true) {
|
public async init(autosave = true) {
|
||||||
if (!this.initialLoad) {
|
if (!this.initialLoad) {
|
||||||
this.initialLoad = new Promise<void>(async (resolve, reject) => {
|
this.initialLoad = new Promise<void>(async (resolve, reject) => {
|
||||||
|
// Create the index folder if it doesn't exist
|
||||||
|
await fs.mkdir(this.indexFolderPath, { recursive: true });
|
||||||
const stat = await fs.stat(this.indexFolderPath);
|
const stat = await fs.stat(this.indexFolderPath);
|
||||||
if (!stat.isDirectory()) {
|
if (!stat.isDirectory()) {
|
||||||
throw new Error(`Invalid index folder path ${this.indexFolderPath}`);
|
throw new Error(`Invalid index folder path ${this.indexFolderPath}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user