MCPcopy Create free account
hub / github.com/davewasmer/devcert / writeProtectedFile

Method writeProtectedFile

src/platforms/linux.ts:106–114  ·  view source on GitHub ↗
(filepath: string, contents: string)

Source from the content-addressed store, hash-verified

104 }
105
106 async writeProtectedFile(filepath: string, contents: string) {
107 assertNotTouchingFiles(filepath, 'write');
108 if (exists(filepath)) {
109 await run('sudo', ['rm', filepath]);
110 }
111 writeFile(filepath, contents);
112 await run('sudo', ['chown', '0', filepath]);
113 await run('sudo', ['chmod', '600', filepath]);
114 }
115
116 private isFirefoxInstalled() {
117 return exists(this.FIREFOX_BIN_PATH);

Callers

nothing calls this directly

Calls 2

assertNotTouchingFilesFunction · 0.90
runFunction · 0.90

Tested by

no test coverage detected