MCPcopy Index your code
hub / github.com/Dokploy/dokploy / createEnvFileCommand

Function createEnvFileCommand

packages/server/src/utils/builders/utils.ts:4–20  ·  view source on GitHub ↗
(
	directory: string,
	env: string | null,
	projectEnv?: string | null,
	environmentEnv?: string | null,
)

Source from the content-addressed store, hash-verified

2import { encodeBase64, prepareEnvironmentVariables } from "../docker/utils";
3
4export 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};

Callers 1

getDockerCommandFunction · 0.90

Calls 2

encodeBase64Function · 0.90

Tested by

no test coverage detected