Carlos Reyna
03/07/2025, 8:42 PMu.PrintErrorMarkdownAndExit though it was only changed on two lines. Is there a reason we did not use it for other errors?
// Construct the full path to the Terraform component by combining the Atmos base path, Terraform base path, and component name
componentPath := filepath.Join(atmosConfig.BasePath, atmosConfig.Components.Terraform.BasePath, info.Component)
componentPathExists, err := u.IsDirectory(componentPath)
if err != nil {
u.PrintErrorMarkdownAndExit("", err, "")
}
if !componentPathExists {
u.PrintErrorMarkdownAndExit("", fmt.Errorf("Component `%s` not found in path: `%s`", info.Component, componentPath), "")
}
readmePath := filepath.Join(componentPath, "README.md")
if _, err := os.Stat(readmePath); err != nil {
if os.IsNotExist(err) {
u.LogErrorAndExit(fmt.Errorf("No README found for component: %s", info.Component))
} else {
u.LogErrorAndExit(fmt.Errorf("Component %s not found", info.Component))
}
}
readmeContent, err := os.ReadFile(readmePath)
if err != nil {
u.LogErrorAndExit(err)
}Andriy Knysh (Cloud Posse)
03/07/2025, 8:50 PMPrintErrorMarkdownAndExit was introduced recently and the code was not updated to use it (not sure why it was not updated in the same file, it's an omission, but it would prob take a separate PR to update all the legacy invocations)Carlos Reyna
03/07/2025, 8:51 PMAndriy Knysh (Cloud Posse)
03/07/2025, 9:02 PMCarlos Reyna
03/07/2025, 9:11 PMErik Osterman (Cloud Posse)
03/07/2025, 11:51 PMShubham Tholiya
03/08/2025, 10:53 AMCarlos Reyna
03/08/2025, 10:54 AM