Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: updates file_utils#FileExists to check for err (#191) #195

Merged
merged 5 commits into from Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/config/config.go
Expand Up @@ -361,7 +361,7 @@ func ProcessConfigForSpacelift() error {
// https://medium.com/@bnprashanth256/reading-configuration-files-and-environment-variables-in-go-golang-c2607f912b63
func processConfigFile(path string, v *viper.Viper) error {
if !u.FileExists(path) {
u.PrintInfoVerbose(fmt.Sprintf("No CLI config found in '%s'", path))
u.PrintInfoVerbose(fmt.Sprintf("No config file atmos.yaml found in path '%s'.", path))
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/file_utils.go
Expand Up @@ -19,7 +19,7 @@ func IsDirectory(path string) (bool, error) {
// FileExists checks if a file exists and is not a directory
func FileExists(filename string) bool {
fileInfo, err := os.Stat(filename)
if os.IsNotExist(err) {
if os.IsNotExist(err) || err != nil {
return false
}
return !fileInfo.IsDir()
Expand Down