github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/runtime/setup/implementations/camel/ape_installer.go (about)

     1  package camel
     2  
     3  import (
     4  	"os"
     5  	"strings"
     6  
     7  	"github.com/ActiveState/cli/internal/logging"
     8  )
     9  
    10  func loadRelocationFile(relocFilePath string) map[string]bool {
    11  	relocBytes, err := os.ReadFile(relocFilePath)
    12  	if err != nil {
    13  		logging.Debug("Could not open relocation file: %v", err)
    14  		return nil
    15  	}
    16  	reloc := string(relocBytes)
    17  	relocMap := map[string]bool{}
    18  	entries := strings.Split(reloc, "\n")
    19  	for _, entry := range entries {
    20  		if entry == "" {
    21  			continue
    22  		}
    23  		info := strings.Split(entry, " ")
    24  		// Place path suffix into map
    25  		relocMap[info[1]] = true
    26  	}
    27  	return relocMap
    28  }