Skip to content

Commit

Permalink
fix binary test
Browse files Browse the repository at this point in the history
  • Loading branch information
417-72KI committed Oct 10, 2023
1 parent 7ba8bbf commit c93a9bc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions Sources/Parser/Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ extension Parser {
func getFileList(at path: Path, environment: String? = nil) throws -> (base: [File], env: [File]) {
let files = try path.children()
.lazy
.filter(\.isValidFile)
.compactMap(File.init(path:))
.filter(\.isYamlOrJson) as [File]
guard let environment else { return (files, []) }
Expand Down
12 changes: 12 additions & 0 deletions Sources/Parser/Util/Path+Extension.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Foundation
import PathKit

extension Path {
var isDsStore: Bool {
lastComponent == dsStoreFileName
}

var isValidFile: Bool {
isFile && !isDsStore
}
}

0 comments on commit c93a9bc

Please sign in to comment.