fix: delete/destroy ordering within directory (#1119)

Fixes #979
This commit is contained in:
KUOKA Yusuke 2020-02-25 09:46:01 +09:00 committed by GitHub
parent 322ed4d1d8
commit f1bdb65777
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -649,9 +649,15 @@ func (a *App) findDesiredStateFiles(specifiedPath string) ([]string, error) {
if err != nil { if err != nil {
return []string{}, err return []string{}, err
} }
sort.Slice(files, func(i, j int) bool { if a.Reverse {
return files[i] < files[j] sort.Slice(files, func(i, j int) bool {
}) return files[j] < files[i]
})
} else {
sort.Slice(files, func(i, j int) bool {
return files[i] < files[j]
})
}
return files, nil return files, nil
} }