MCPcopy Create free account
hub / github.com/codegowhere/react-inject-env / outputEnvFile

Function outputEnvFile

src/utils/File.ts:48–53  ·  view source on GitHub ↗
(folder: string, fileName: string, envCfg: Record<string, string>, varName: string)

Source from the content-addressed store, hash-verified

46}
47
48export function outputEnvFile(folder: string, fileName: string, envCfg: Record<string, string>, varName: string) {
49 shell.mkdir('-p', './build')
50 console.info('Setting the following environment variables:')
51 console.info(envCfg)
52 writeFileSync(`${folder}/${fileName}`, `window.${varName} = ${JSON.stringify(envCfg, null, 2)}`)
53}

Callers 1

onExecuteMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected