MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / writeFile

Method writeFile

src/services/MdbaseSpecService.ts:142–151  ·  view source on GitHub ↗

* Write a file, creating it if it doesn't exist or updating if it does.

(path: string, content: string)

Source from the content-addressed store, hash-verified

140 * Write a file, creating it if it doesn't exist or updating if it does.
141 */
142 private async writeFile(path: string, content: string): Promise<void> {
143 const vault = this.plugin.app.vault;
144 const fileExists = await vault.adapter.exists(path);
145
146 if (fileExists) {
147 await vault.adapter.write(path, content);
148 } else {
149 await vault.create(path, content);
150 }
151 }
152
153 /**
154 * Build the mdbase.yaml content.

Callers 2

generateMethod · 0.95
mainFunction · 0.80

Calls 2

existsMethod · 0.80
createMethod · 0.65

Tested by

no test coverage detected