improve cmd wrapper with comment removal support

This commit is contained in:
mbecker20
2025-11-11 00:43:54 -08:00
parent 7bf44d2e04
commit 7ecd2b0b0b
2 changed files with 20 additions and 13 deletions
+18 -11
View File
@@ -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<super::Args> 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");
@@ -445,8 +445,8 @@ export const StackConfig = ({
compose_cmd_wrapper: (value, set) => (
<MonacoEditor
value={
value ||
"# Example: sops exec-env .encrypted.env '[[COMPOSE_COMMAND]]'\n# [[COMPOSE_COMMAND]] is a placeholder for the full compose command\n"
value ??
"# sops exec-env .encrypted.env '[[COMPOSE_COMMAND]]'\n"
}
language="shell"
onValueChange={(compose_cmd_wrapper) =>