feat: add support for custom command

This commit is contained in:
Mauricio Siu
2024-12-22 01:51:05 -06:00
parent 54dd531a26
commit a710728e77
2 changed files with 14 additions and 7 deletions

View File

@@ -48,6 +48,8 @@ Compose Type: ${composeType} ✅`;
writeStream.write(`\n${logBox}\n`);
const projectPath = join(COMPOSE_PATH, compose.appName, "code");
console.log("Command:", ...command.split(" "));
await spawnAsync(
"docker",
[...command.split(" ")],
@@ -144,6 +146,10 @@ const sanitizeCommand = (command: string) => {
export const createCommand = (compose: ComposeNested) => {
const { composeType, appName, sourceType } = compose;
if (compose.command) {
return `${sanitizeCommand(compose.command)}`;
}
const path =
sourceType === "raw" ? "docker-compose.yml" : compose.composePath;
let command = "";
@@ -154,12 +160,6 @@ export const createCommand = (compose: ComposeNested) => {
command = `stack deploy -c ${path} ${appName} --prune`;
}
const customCommand = sanitizeCommand(compose.command);
if (customCommand) {
command = `${command} ${customCommand}`;
}
return command;
};