gitリポジトリのurlを貼り付けるだけでアプリケーションのビルドを実行するアプリ。 macOS用
Révision | 4cdbaf87cbafa5a85bbe0ed83e99743806e4ee62 (tree) |
---|---|
l'heure | 2018-04-08 14:29:09 |
Auteur | masakih <masakih@user...> |
Commiter | masakih |
Cartfile検索を厳格にした
@@ -26,7 +26,7 @@ final class Carthage { | ||
26 | 26 | |
27 | 27 | private var cartfileURL: URL? { |
28 | 28 | |
29 | - return findFile(pattern: "Cartfile$", in: baseURL, depth: 2) | |
29 | + return findFile(pattern: "^Cartfile$", in: baseURL, depth: 2) | |
30 | 30 | } |
31 | 31 | |
32 | 32 | private var carthageURL: URL? { |
@@ -33,7 +33,7 @@ func findFile(pattern: String, in url: URL, depth: Int = 1) -> URL? { | ||
33 | 33 | return nil |
34 | 34 | } |
35 | 35 | |
36 | - if let url = contents.lazy.filter({ $0.path.match(pattern) }).first { | |
36 | + if let url = contents.lazy.filter({ $0.lastPathComponent.match(pattern) }).first { | |
37 | 37 | |
38 | 38 | return url |
39 | 39 | } |
@@ -39,6 +39,12 @@ class AppBuilderWithGitTests: XCTestCase { | ||
39 | 39 | XCTAssertFalse("Hoge.xcodeproj.copy".match("\\w*\\.xcodeproj$")) |
40 | 40 | |
41 | 41 | XCTAssertFalse(".xcodeproj.copy".match("\\w*\\.xcodeproj$")) |
42 | + | |
43 | + | |
44 | + XCTAssertTrue("Cartfile".match("^Cartfile$")) | |
45 | + XCTAssertFalse("hogeCartfile".match("^Cartfile$")) | |
46 | + XCTAssertFalse("Cartfilehoge".match("^Cartfile$")) | |
47 | + | |
42 | 48 | } |
43 | 49 | |
44 | 50 |