INNER CODE UNIT · Go

readOldConfig

transcend-io/terragrunt-atlantis-config · cmd/config.go:74

func readOldConfig() (*AtlantisConfig, error) {
	// The old file not existing is not an error, as it should not exist on the very first run
	bytes, err := os.ReadFile(outputPath)
	if err != nil {
		log.Info("Could not find an old config file. Starting from scratch")
		return nil, nil
	}

	// The old file being malformed is an actual error
	config := AtlantisConfig{}
	err = yaml.Unmarshal(bytes, &config)
	if err != nil {
		return nil, err
	}

	return &config, nil
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…