remove indentation from json output of `show` and `providers schema` (#20623)
* command/providers schema: correct help text * command/show: remove indentation from json output * command/providers schema: remove indentation from json output
This commit is contained in:
parent
dc154cf242
commit
30672faebe
|
@ -135,8 +135,7 @@ func Marshal(
|
|||
return nil, fmt.Errorf("error marshaling config: %s", err)
|
||||
}
|
||||
|
||||
// add some polish
|
||||
ret, err := json.MarshalIndent(output, "", " ")
|
||||
ret, err := json.Marshal(output)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
|
|
|
@ -42,8 +42,7 @@ func Marshal(s *terraform.Schemas) ([]byte, error) {
|
|||
providers.Schemas[k] = marshalProvider(v)
|
||||
}
|
||||
|
||||
// add some polish for the human consumers
|
||||
ret, err := json.MarshalIndent(providers, "", " ")
|
||||
ret, err := json.Marshal(providers)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ func Marshal(sf *statefile.File, schemas *terraform.Schemas) ([]byte, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
ret, err := json.MarshalIndent(output, "", " ")
|
||||
ret, err := json.Marshal(output)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
|
|
|
@ -45,6 +45,12 @@ func (c *ProvidersSchemaCommand) Run(args []string) int {
|
|||
return 1
|
||||
}
|
||||
|
||||
// Check for user-supplied plugin path
|
||||
if c.pluginPath, err = c.loadPluginPath(); err != nil {
|
||||
c.Ui.Error(fmt.Sprintf("Error loading plugin path: %s", err))
|
||||
return 1
|
||||
}
|
||||
|
||||
var diags tfdiags.Diagnostics
|
||||
|
||||
// Load the backend
|
||||
|
@ -100,7 +106,7 @@ func (c *ProvidersSchemaCommand) Run(args []string) int {
|
|||
}
|
||||
|
||||
const providersSchemaCommandHelp = `
|
||||
Usage: terraform providers schemas -json
|
||||
Usage: terraform providers schema -json
|
||||
|
||||
Prints out a json representation of the schemas for all providers used
|
||||
in the current configuration.
|
||||
|
|
Loading…
Reference in New Issue