( directory: string, env: string | null, projectEnv?: string | null, environmentEnv?: string | null, )
| 2 | import { encodeBase64, prepareEnvironmentVariables } from "../docker/utils"; |
| 3 | |
| 4 | export const createEnvFileCommand = ( |
| 5 | directory: string, |
| 6 | env: string | null, |
| 7 | projectEnv?: string | null, |
| 8 | environmentEnv?: string | null, |
| 9 | ) => { |
| 10 | const envFileContent = prepareEnvironmentVariables( |
| 11 | env, |
| 12 | projectEnv, |
| 13 | environmentEnv, |
| 14 | ).join("\n"); |
| 15 | |
| 16 | const encodedContent = encodeBase64(envFileContent || ""); |
| 17 | const envFilePath = join(dirname(directory), ".env"); |
| 18 | |
| 19 | return `echo "${encodedContent}" | base64 -d > "${envFilePath}";`; |
| 20 | }; |
no test coverage detected