feat: change project config file name to envy.toml

This commit is contained in:
2025-09-25 22:51:05 +05:30
parent 2a65f855ae
commit 96bed0abdc
4 changed files with 26 additions and 26 deletions

View File

@@ -25,20 +25,20 @@ func GetEnvy() (*toml.Tree, error) {
return nil, errors.New("Not able to fetch working directory: " + err.Error())
}
_, err = os.Stat(path.Join(cwd, ".envy"))
_, err = os.Stat(path.Join(cwd, "envy.toml"))
// file exists
if err == nil {
envyFile, err := toml.LoadFile(path.Join(cwd, ".envy"))
envyFile, err := toml.LoadFile(path.Join(cwd, "envy.toml"))
if err != nil {
return nil, errors.New("Error occured while reading .envy file:" + err.Error())
return nil, errors.New("Error occured while reading envy.toml file:" + err.Error())
}
return envyFile, nil
}
// file does not exist
if os.IsNotExist(err) {
return nil, errors.New(".envy file doesn't exist in the current directory")
return nil, errors.New("envy.toml file doesn't exist in the current directory")
} else {
return nil, errors.New("Some error occured:" + err.Error())
}