equal
deleted
inserted
replaced
112 jww.ERROR.Println("Couldn't discover absolute path") |
112 jww.ERROR.Println("Couldn't discover absolute path") |
113 jww.ERROR.Println(err) |
113 jww.ERROR.Println(err) |
114 return "" |
114 return "" |
115 } |
115 } |
116 |
116 |
117 // Check if File / Directory Exists |
117 // Check if file Exists |
118 func exists(fs afero.Fs, path string) (bool, error) { |
118 func exists(fs afero.Fs, path string) (bool, error) { |
119 _, err := fs.Stat(path) |
119 stat, err := fs.Stat(path) |
120 if err == nil { |
120 if err == nil { |
121 return true, nil |
121 return !stat.IsDir(), nil |
122 } |
122 } |
123 if os.IsNotExist(err) { |
123 if os.IsNotExist(err) { |
124 return false, nil |
124 return false, nil |
125 } |
125 } |
126 return false, err |
126 return false, err |