MCPcopy
hub / github.com/prisma/prisma / getEnvVarToUse

Function getEnvVarToUse

packages/fetch-engine/src/env.ts:48–71  ·  view source on GitHub ↗
(binaryType: BinaryType)

Source from the content-addressed store, hash-verified

46}
47
48function getEnvVarToUse(binaryType: BinaryType): string {
49 const envVar = engineEnvVarMap[binaryType]
50 const deprecatedEnvVar = deprecatedEnvVarMap[binaryType]
51
52 if (deprecatedEnvVar && process.env[deprecatedEnvVar]) {
53 if (process.env[envVar]) {
54 console.warn(
55 `${yellow('prisma:warn')} Both ${bold(envVar)} and ${bold(deprecatedEnvVar)} are specified, ${bold(
56 envVar,
57 )} takes precedence. ${bold(deprecatedEnvVar)} is deprecated.`,
58 )
59 return envVar
60 } else {
61 console.warn(
62 `${yellow('prisma:warn')} ${bold(deprecatedEnvVar)} environment variable is deprecated, please use ${bold(
63 envVar,
64 )} instead`,
65 )
66 return deprecatedEnvVar
67 }
68 }
69
70 return envVar
71}
72
73export function allEngineEnvVarsSet(binaries: string[]): boolean {
74 for (const binaryType of binaries) {

Callers 1

getBinaryEnvVarPathFunction · 0.85

Calls 1

warnMethod · 0.80

Tested by

no test coverage detected