Refactor command building and argument handling

This commit is contained in:
2025-09-25 22:05:46 +02:00
parent 2d925b473d
commit bc9e0535c3
6 changed files with 122 additions and 267 deletions

View File

@@ -372,8 +372,13 @@ func (i *Process) buildCommand() (*exec.Cmd, error) {
return nil, err
}
// Delegate to the backend's BuildCommand method
return i.options.BuildCommand(i.ctx, backendConfig)
// Get the command to execute
cmd := i.options.GetCommand(backendConfig)
// Build command arguments
args := i.options.BuildCommandArgs(backendConfig)
return exec.Command(cmd, args...), nil
}
// getBackendConfig resolves the backend configuration for the current instance
@@ -394,4 +399,3 @@ func (i *Process) getBackendConfig() (*config.BackendSettings, error) {
settings := i.globalBackendSettings.GetBackendSettings(backendTypeStr)
return &settings, nil
}