fix interface cast

This commit is contained in:
Alvaro Muñoz
2023-03-24 13:47:49 +01:00
parent 2eb968d2be
commit 92bfdeb933

12
main.go
View File

@@ -145,7 +145,7 @@ func fixPackFile(queryPackDir string, packRelativePath string) error {
// if value is a string and value contains `${workspace}`
if value == "${workspace}" {
// replace the value with `*`
packData["dependencies"].(map[string]string)[key] = "*"
packData["dependencies"].(map[string]interface{})[key] = "*"
}
}
}
@@ -493,11 +493,15 @@ type Config struct {
func main() {
// read config file
homePath := os.Getenv("XDG_CONFIG_HOME")
configPath := os.Getenv("XDG_CONFIG_HOME")
if configPath == "" {
homePath := os.Getenv("HOME")
if homePath == "" {
homePath = os.Getenv("HOME")
log.Fatal("HOME environment variable not set")
}
configFilePath = filepath.Join(homePath, ".config", "mrva", "config.yml")
configPath = filepath.Join(homePath, ".config")
}
configFilePath = filepath.Join(configPath, "mrva", "config.yml")
if _, err := os.Stat(configFilePath); os.IsNotExist(err) {
// create config file if it doesn't exist
// since we will use it for the name/ids cache