MCPcopy Index your code
hub / github.com/rilldata/rill / writeFileEnsuringDir

Function writeFileEnsuringDir

web-common/tests/utils/fs.ts:11–21  ·  view source on GitHub ↗
(
  filePath: string,
  data: string,
  options?: fs.WriteFileOptions,
)

Source from the content-addressed store, hash-verified

9 * @param options - Optional write options (encoding, flag, etc.).
10 */
11export function writeFileEnsuringDir(
12 filePath: string,
13 data: string,
14 options?: fs.WriteFileOptions,
15): void {
16 const dir = path.dirname(filePath);
17 if (!fs.existsSync(dir)) {
18 fs.mkdirSync(dir, { recursive: true });
19 }
20 fs.writeFileSync(filePath, data, options);
21}

Callers 2

setup.tsFile · 0.90
setup.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected