mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Replace os.Stat with IsDir, simplifying FS abstraction.
This commit is contained in:
@@ -84,9 +84,8 @@ func (o *addBaseOptions) RunAddBase(fsys fs.FileSystem) error {
|
||||
// split directory paths
|
||||
paths := strings.Split(o.baseDirectoryPaths, ",")
|
||||
for _, path := range paths {
|
||||
_, err := fsys.Stat(path)
|
||||
if err != nil {
|
||||
return err
|
||||
if !fsys.Exists(path) {
|
||||
return errors.New(path + " does not exist")
|
||||
}
|
||||
if stringInSlice(path, m.Bases) {
|
||||
return fmt.Errorf("base %s already in kustomization file", path)
|
||||
|
||||
Reference in New Issue
Block a user