MCPcopy
hub / github.com/UdaraJay/Pile / save

Method save

src/main/utils/pileIndex.js:199–214  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

197 }
198
199 save() {
200 if (!this.pilePath) return;
201 if (!fs.existsSync(this.pilePath)) {
202 fs.mkdirSync(this.pilePath, { recursive: true });
203 }
204
205 const sortedIndex = this.sortMap(this.index);
206 this.index = sortedIndex;
207 const filePath = path.join(this.pilePath, this.fileName);
208 const entries = this.index.entries();
209
210 if (!entries) return;
211
212 let strMap = JSON.stringify(Array.from(entries));
213 fs.writeFileSync(filePath, strMap);
214 }
215}
216
217module.exports = new PileIndex();

Callers 6

loadMethod · 0.95
addMethod · 0.95
updateParentOfReplyMethod · 0.95
regenerateEmbeddingsMethod · 0.95
updateMethod · 0.95
removeMethod · 0.95

Calls 1

sortMapMethod · 0.95

Tested by

no test coverage detected