From 7ecd2b0b0b61ad73c24769bbbb91fe6bc84a64ac Mon Sep 17 00:00:00 2001 From: mbecker20 Date: Tue, 11 Nov 2025 00:43:54 -0800 Subject: [PATCH] improve cmd wrapper with comment removal support --- bin/periphery/src/api/compose/mod.rs | 29 ++++++++++++------- .../src/components/resources/stack/config.tsx | 4 +-- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/bin/periphery/src/api/compose/mod.rs b/bin/periphery/src/api/compose/mod.rs index 7d1fb3ce4..94a0de82c 100644 --- a/bin/periphery/src/api/compose/mod.rs +++ b/bin/periphery/src/api/compose/mod.rs @@ -8,14 +8,18 @@ use command::{ use formatting::format_serror; use git::write_commit_file; use interpolate::Interpolator; -use komodo_client::entities::{ - FileContents, RepoExecutionResponse, all_logs_success, - stack::{ - ComposeFile, ComposeProject, ComposeService, - ComposeServiceDeploy, StackRemoteFileContents, StackServiceNames, +use komodo_client::{ + entities::{ + FileContents, RepoExecutionResponse, all_logs_success, + stack::{ + ComposeFile, ComposeProject, ComposeService, + ComposeServiceDeploy, StackRemoteFileContents, + StackServiceNames, + }, + to_path_compatible_name, + update::Log, }, - to_path_compatible_name, - update::Log, + parsers::parse_multiline_command, }; use periphery_client::api::compose::*; use resolver_api::Resolve; @@ -661,10 +665,13 @@ impl Resolve for ComposeUp { let mut command = format!( "{docker_compose} -p {project_name} -f {file_args}{env_file_args} up -d{extra_args}{service_args}", ); - - // Apply wrapper if configured - if !stack.config.compose_cmd_wrapper.is_empty() { - command = stack.config.compose_cmd_wrapper.replace("[[COMPOSE_COMMAND]]", &command); + + // Apply compose cmd wrapper if configured + let compose_cmd_wrapper = + parse_multiline_command(&stack.config.compose_cmd_wrapper); + if !compose_cmd_wrapper.is_empty() { + command = + compose_cmd_wrapper.replace("[[COMPOSE_COMMAND]]", &command); } let span = info_span!("RunComposeUp"); diff --git a/frontend/src/components/resources/stack/config.tsx b/frontend/src/components/resources/stack/config.tsx index e29c60b10..3fc458a67 100644 --- a/frontend/src/components/resources/stack/config.tsx +++ b/frontend/src/components/resources/stack/config.tsx @@ -445,8 +445,8 @@ export const StackConfig = ({ compose_cmd_wrapper: (value, set) => (