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

Method writeProtectedFile

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

Source from the content-addressed store, hash-verified

112 }
113
114 async writeProtectedFile(filepath: string, contents: string) {
115 assertNotTouchingFiles(filepath, 'write');
116 if (exists(filepath)) {
117 await run('sudo', ['rm', filepath]);
118 }
119 writeFile(filepath, contents);
120 await run('sudo', ['chown', '0', filepath]);
121 await run('sudo', ['chmod', '600', filepath]);
122 }
123
124 private isFirefoxInstalled() {
125 return exists(this.FIREFOX_BUNDLE_PATH);

Callers

nothing calls this directly

Calls 2

assertNotTouchingFilesFunction · 0.90
runFunction · 0.90

Tested by

no test coverage detected