MCPcopy
hub / github.com/coder/code-server / read

Method read

src/node/settings.ts:17–27  ·  view source on GitHub ↗

* Read settings from the file. On a failure return last known settings and * log a warning.

()

Source from the content-addressed store, hash-verified

15 * log a warning.
16 */
17 public async read(): Promise<T> {
18 try {
19 const raw = (await fs.readFile(this.settingsPath, "utf8")).trim()
20 return raw ? JSON.parse(raw) : ({} as T)
21 } catch (error: any) {
22 if (error.code !== "ENOENT") {
23 logger.warn(error.message)
24 }
25 }
26 return {} as T
27 }
28
29 /**
30 * Write settings combined with current settings. On failure log a warning.

Callers 5

writeMethod · 0.95
update.test.tsFile · 0.80
settings.test.tsFile · 0.80
_getUpdateMethod · 0.80
vscode.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected