fix(raw): add raw compose remote

This commit is contained in:
Mauricio Siu
2024-09-12 01:44:21 -06:00
parent bf58ae0f0f
commit 0bd0da2ee4

View File

@@ -32,7 +32,13 @@ export const getCreateComposeFileCommand = (compose: Compose) => {
const { appName, composeFile } = compose;
const outputPath = join(COMPOSE_PATH, appName, "code");
const filePath = join(outputPath, "docker-compose.yml");
return `echo "${composeFile}" > ${filePath}`;
const command = [];
command.push(`rm -rf ${outputPath};`);
command.push(`mkdir -p ${outputPath};`);
command.push(
`printf '%s' '${composeFile.replace(/'/g, "'\\''")}' > ${filePath};`,
);
return command.join("\n");
};
export const createComposeFileRaw = async (compose: Compose) => {