mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
update to warn if schemas aren't available
This commit is contained in:
@@ -164,19 +164,17 @@ func (c *StateReplaceProviderCommand) Run(args []string) int {
|
||||
// Get schemas, if possible, before writing state
|
||||
path, err := os.Getwd()
|
||||
if err != nil {
|
||||
return 1
|
||||
c.Ui.Warn(fmt.Sprintf(failedToLoadSchemasMessage, err))
|
||||
}
|
||||
|
||||
config, diags := c.loadConfig(path)
|
||||
if diags.HasErrors() {
|
||||
// MBANG TODO - add warnings here?
|
||||
return 1
|
||||
c.Ui.Warn(fmt.Sprintf(failedToLoadSchemasMessage, err))
|
||||
}
|
||||
|
||||
|
||||
schemas, diags := getSchemas(&c.Meta, state, config)
|
||||
if diags.HasErrors() {
|
||||
c.Ui.Error(fmt.Sprintf("Failed to load schemas: %s", err))
|
||||
return 1
|
||||
c.Ui.Warn(fmt.Sprintf(failedToLoadSchemasMessage, err))
|
||||
}
|
||||
|
||||
// Write the updated state
|
||||
|
||||
Reference in New Issue
Block a user