MCPcopy Create free account
hub / github.com/cypress-io/cypress / getCloudEnvironmentFileSource

Function getCloudEnvironmentFileSource

scripts/binary/binary-sources.js:78–90  ·  view source on GitHub ↗
(cloudApiFilePath)

Source from the content-addressed store, hash-verified

76}
77
78const getCloudEnvironmentFileSource = async (cloudApiFilePath) => {
79 const fileContents = await fs.readFile(cloudApiFilePath, 'utf8')
80
81 if (!fileContents.includes('process.env.CYPRESS_ENV_DEPENDENCIES')) {
82 throw new Error(`Expected to find CYPRESS_ENV_DEPENDENCIES in cloud api file`)
83 }
84
85 if (process.env.CYPRESS_ENV_DEPENDENCIES) {
86 return fileContents.replace('process.env.CYPRESS_ENV_DEPENDENCIES', `'${process.env.CYPRESS_ENV_DEPENDENCIES}'`)
87 }
88
89 return fileContents
90}
91
92const validateCloudEnvironmentFile = async (cloudApiFilePath) => {
93 if (process.env.CYPRESS_ENV_DEPENDENCIES) {

Callers 1

after-pack-hook.jsFile · 0.85

Calls 1

readFileMethod · 0.80

Tested by

no test coverage detected