refactor(compose): streamline command generation in deployCompose function

- Removed redundant command initialization and ensured proper command structure for deployment.
- Enhanced clarity by consolidating command building logic, improving maintainability of the deployCompose function.
This commit is contained in:
Mauricio Siu
2026-02-17 11:45:11 -06:00
parent 46e1bed5e9
commit 6350a8ddd3
2 changed files with 1 additions and 4 deletions

View File

@@ -248,7 +248,7 @@ export const deployCompose = async ({
} else {
await execAsync(commandWithLog);
}
command = "set -e;";
if (compose.sourceType !== "raw") {
command += await generateApplyPatchesCommand({
id: compose.composeId,
@@ -257,7 +257,6 @@ export const deployCompose = async ({
});
}
command = "set -e;";
command += await getBuildComposeCommand(entity);
commandWithLog = `(${command}) >> ${deployment.logPath} 2>&1`;
if (compose.serverId) {

View File

@@ -146,7 +146,6 @@ export const generateApplyPatchesCommand = async ({
const codePath = join(basePath, entity.appName, "code");
const resultPatches = await findPatchesByEntityId(id, type);
const patches = resultPatches.filter((p) => p.enabled);
let command = `echo "Applying ${patches.length} patch(es)...";`;
@@ -159,7 +158,6 @@ export const generateApplyPatchesCommand = async ({
rm -f "${filePath}";
`;
} else {
// create and update: write file
command += `
file="${filePath}"
dir="$(dirname "$file")"