Skip to content

Commit

Permalink
[add] output to the status update.
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarcella committed Aug 21, 2024
1 parent 2e62390 commit e084648
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/engine/environments/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type AzureDeploymentStatus struct {
Status string `json:"status"`
ResourceURIs []string `json:"resourceURIs"`
Error string `json:"error"`
Output string `json:"output"`
}

func NewAzureDeploymentStatus() AzureDeploymentStatus {
Expand Down Expand Up @@ -67,6 +68,10 @@ func (status *AzureDeploymentStatus) SetError(err error) {
status.Error = err.Error()
}

func (status *AzureDeploymentStatus) SetOutput(output string) {
status.Output = output
}

// Print out the status JSON for azure/cloudshell if in the correct environment.
func ReportAzureStatus(status AzureDeploymentStatus, environment string) {
if !IsAzureEnvironment(environment) {
Expand Down Expand Up @@ -109,7 +114,6 @@ func AttachResourceURIsToAzureStatus(
resourceGroupName string,
environment string,
) {

if !IsAzureEnvironment(environment) {
logging.GlobalLogger.Info(
"Not fetching resource URIs because we're not in the OCD environment.",
Expand Down
3 changes: 3 additions & 0 deletions internal/engine/interactive/interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ func (model InteractiveModeModel) Update(message tea.Msg) (tea.Model, tea.Cmd) {
model.resourceGroupName,
model.environment,
)
model.azureStatus.SetOutput(strings.Join(model.CommandLines, "\n"))
commands = append(
commands,
tea.Sequence(
Expand Down Expand Up @@ -315,6 +316,8 @@ func (model InteractiveModeModel) Update(message tea.Msg) (tea.Model, tea.Cmd) {
model.resourceGroupName,
model.environment,
)

model.azureStatus.SetOutput(strings.Join(model.CommandLines, "\n"))
commands = append(
commands,
tea.Sequence(
Expand Down

0 comments on commit e084648

Please sign in to comment.