MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / check

Function check

src/lib/saveFile.js:188–204  ·  view source on GitHub ↗
(url, filename)

Source from the content-addressed store, hash-verified

186 }
187
188 async function check(url, filename) {
189 const pathname = Url.join(url, filename);
190
191 const fs = fsOperation(pathname);
192 if (!(await fs.exists())) return filename;
193
194 const action = await select(strings["file already exists"], [
195 ["overwrite", strings.overwrite],
196 ["newname", strings["enter file name"]],
197 ]);
198
199 if (action === "newname") {
200 filename = await getfilename(url, filename);
201 }
202
203 return filename;
204 }
205}
206
207export default saveFile;

Callers 2

saveFileFunction · 0.70
getfilenameFunction · 0.70

Calls 4

fsOperationFunction · 0.85
getfilenameFunction · 0.85
selectFunction · 0.70
existsMethod · 0.65

Tested by

no test coverage detected