fix interface cast
This commit is contained in:
14
main.go
14
main.go
@@ -145,7 +145,7 @@ func fixPackFile(queryPackDir string, packRelativePath string) error {
|
|||||||
// if value is a string and value contains `${workspace}`
|
// if value is a string and value contains `${workspace}`
|
||||||
if value == "${workspace}" {
|
if value == "${workspace}" {
|
||||||
// replace the value with `*`
|
// 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() {
|
func main() {
|
||||||
|
|
||||||
// read config file
|
// read config file
|
||||||
homePath := os.Getenv("XDG_CONFIG_HOME")
|
configPath := os.Getenv("XDG_CONFIG_HOME")
|
||||||
if homePath == "" {
|
if configPath == "" {
|
||||||
homePath = os.Getenv("HOME")
|
homePath := os.Getenv("HOME")
|
||||||
|
if homePath == "" {
|
||||||
|
log.Fatal("HOME environment variable not set")
|
||||||
|
}
|
||||||
|
configPath = filepath.Join(homePath, ".config")
|
||||||
}
|
}
|
||||||
configFilePath = filepath.Join(homePath, ".config", "mrva", "config.yml")
|
configFilePath = filepath.Join(configPath, "mrva", "config.yml")
|
||||||
if _, err := os.Stat(configFilePath); os.IsNotExist(err) {
|
if _, err := os.Stat(configFilePath); os.IsNotExist(err) {
|
||||||
// create config file if it doesn't exist
|
// create config file if it doesn't exist
|
||||||
// since we will use it for the name/ids cache
|
// since we will use it for the name/ids cache
|
||||||
|
|||||||
Reference in New Issue
Block a user