mirror of
https://github.com/silicoflare/envy.git
synced 2026-05-26 19:57:59 +05:30
feat: change project config file name to envy.toml
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user