mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-20 22:55:22 +02:00
- Updated the ShowDockerLogs component to use optional chaining when accessing the error property of services, preventing potential runtime errors. - Refactored the deployApplication function to create an applicationEntity object, ensuring consistent use of serverId across repository cloning functions. - Removed unused createEnvFile function from utils, streamlining the codebase.
21 lines
564 B
TypeScript
21 lines
564 B
TypeScript
import { dirname, join } from "node:path";
|
|
import { encodeBase64, prepareEnvironmentVariables } from "../docker/utils";
|
|
|
|
export const createEnvFileCommand = (
|
|
directory: string,
|
|
env: string | null,
|
|
projectEnv?: string | null,
|
|
environmentEnv?: string | null,
|
|
) => {
|
|
const envFileContent = prepareEnvironmentVariables(
|
|
env,
|
|
projectEnv,
|
|
environmentEnv,
|
|
).join("\n");
|
|
|
|
const encodedContent = encodeBase64(envFileContent || "");
|
|
const envFilePath = join(dirname(directory), ".env");
|
|
|
|
return `echo "${encodedContent}" | base64 -d > "${envFilePath}";`;
|
|
};
|