Skip to content

Commit 43663e5

Browse files
committed
add standard output
1 parent 4319ac0 commit 43663e5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/tfschema/tfschema.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,16 @@ func getResourceSchema(resourceType string, resource hclwrite.Block, dir string,
175175
out, err := cmd.Output()
176176
if err != nil {
177177
var ee *exec.ExitError
178-
if errors.As(err, &ee) {
178+
if errors.As(err, &ee) && ee.Stderr != nil {
179179
log.Println("===============================================")
180180
log.Printf("Error output: %s\n", string(ee.Stderr))
181181
log.Println("===============================================")
182182
}
183183

184+
log.Println("===============================================")
185+
log.Printf("Standard output: %s\n", string(out))
186+
log.Println("===============================================")
187+
184188
return nil, fmt.Errorf("failed to execute '%s providers schema -json' command in directory '%s': %w", name, dir, err)
185189
}
186190

0 commit comments

Comments
 (0)