Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbff96b6

Browse files
committed
Only show job status if completed
1 parentdc86c0e commitbff96b6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎cli/projectcreate.go‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,13 @@ func doProjectLoop(cmd *cobra.Command, client *codersdk.Client, organization cod
131131
iferr!=nil {
132132
returnnil,err
133133
}
134+
logBuffer:=make([]coderd.ProvisionerJobLog,0,64)
134135
for {
135-
_,ok:=<-logs
136+
log,ok:=<-logs
136137
if!ok {
137138
break
138139
}
139-
// _, _ = fmt.Fprintf(cmd.OutOrStdout(), "%s %s\n", color.HiGreenString("[tf]"),log.Output)
140+
logBuffer=append(logBuffer,log)
140141
}
141142

142143
job,err=client.ProvisionerJob(cmd.Context(),organization.Name,job.ID)
@@ -184,6 +185,10 @@ func doProjectLoop(cmd *cobra.Command, client *codersdk.Client, organization cod
184185
}
185186

186187
ifjob.Status!=coderd.ProvisionerJobStatusSucceeded {
188+
for_,log:=rangelogBuffer {
189+
_,_=fmt.Fprintf(cmd.OutOrStdout(),"%s %s\n",color.HiGreenString("[tf]"),log.Output)
190+
}
191+
187192
returnnil,xerrors.New(job.Error)
188193
}
189194

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp