MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / update

Method update

lib/models/files.ts:246–264  ·  view source on GitHub ↗
(
    userId: string,
    path: string,
    name: string,
    contents: string,
  )

Source from the content-addressed store, hash-verified

244 }
245
246 static async update(
247 userId: string,
248 path: string,
249 name: string,
250 contents: string,
251 ): Promise<boolean> {
252 await ensureUserPathIsValidAndSecurelyAccessible(userId, join(path, name));
253
254 const rootPath = join(await AppConfig.getFilesRootPath(), userId, path);
255
256 try {
257 await Deno.writeTextFile(join(rootPath, name), contents, { append: false, createNew: false });
258 } catch (error) {
259 console.error(error);
260 return false;
261 }
262
263 return true;
264 }
265
266 static async get(
267 userId: string,

Callers

nothing calls this directly

Tested by

no test coverage detected