MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / touchFile

Function touchFile

frontend/src/hooks/useFileManager.ts:343–365  ·  view source on GitHub ↗
(dir?: boolean)

Source from the content-addressed store, hash-verified

341 };
342
343 const touchFile = async (dir?: boolean) => {
344 clearSelected();
345 const dirname = dir
346 ? await openDialog(t("TXT_CODE_6215388a"), t("TXT_CODE_1b450b79"))
347 : await openDialog(t("TXT_CODE_791c73e9"), t("TXT_CODE_59cb16ff"));
348 const execute = dir ? addFolderApi().execute : touchFileApi().execute;
349
350 try {
351 await execute({
352 params: {
353 uuid: instanceId || "",
354 daemonId: daemonId || ""
355 },
356 data: {
357 target: currentPath.value + dirname
358 }
359 });
360 await getFileList();
361 message.success(t("TXT_CODE_d28c05df"));
362 } catch (error: any) {
363 return reportErrorMsg(error.message);
364 }
365 };
366
367 const setClipBoard = (type: "copy" | "move", file?: string) => {
368 if (file) {

Callers

nothing calls this directly

Calls 5

reportErrorMsgFunction · 0.90
clearSelectedFunction · 0.85
executeFunction · 0.85
getFileListFunction · 0.85
openDialogFunction · 0.70

Tested by

no test coverage detected