INNER CODE UNIT · Go
func
intigriti/misconfig-mapper · internal/service/service.go:31
func (m *MisconfigMapper) GetTerminalWidth() int {
fd := int(os.Stdout.Fd())
width, _, _ := term.GetSize(fd)
if width <= 0 {
width = 80 // Default width
}
return width
}
// Run executes the main application logic
func (m *MisconfigMapper) Run() error {
termWidth := m.GetTerminalWidth()
// Update templates if requested
if m.Config.UpdateTemplates {
serviceFilePath := filepath.Join(m.Config.TemplatesPath, "services.json")
fileExists := templates.IsFile(serviceFilePath)
if err := m.Templates.UpdateTemplates(fileExists); err != nil {