MCPcopy Create free account
hub / github.com/netlify/cli / withEnvFile

Method withEnvFile

tests/integration/utils/site-builder.ts:221–241  ·  view source on GitHub ↗
({
    env = {},
    path: filePath = '.env',
    pathPrefix = '',
  }: {
    env?: any
    path?: string
    pathPrefix?: string
  })

Source from the content-addressed store, hash-verified

219 }
220
221 withEnvFile({
222 env = {},
223 path: filePath = '.env',
224 pathPrefix = '',
225 }: {
226 env?: any
227 path?: string
228 pathPrefix?: string
229 }) {
230 const dest = path.join(this.directory, pathPrefix, filePath)
231 this.tasks.push(async () => {
232 await ensureDir(path.dirname(dest))
233 await writeFile(
234 dest,
235 Object.entries(env)
236 .map(([key, value]) => `${key}=${value}`)
237 .join(os.EOL),
238 )
239 })
240 return this
241 }
242
243 withGit({ repoUrl = 'git@github.com:owner/repo.git' }: { repoUrl?: string } = {}) {
244 this.tasks.push(async () => {

Callers 6

envelope.test.tsFile · 0.80
dev.config.test.tsFile · 0.80
dev.exec.test.tsFile · 0.80
env.test.tsFile · 0.80
dot-env.test.tsFile · 0.80

Calls 2

ensureDirFunction · 0.85
writeFileFunction · 0.50

Tested by

no test coverage detected