• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

gitリポジトリのurlを貼り付けるだけでアプリケーションのビルドを実行するアプリ。 macOS用


Commit MetaInfo

Revisionf7bf2573e3e77fecd0aaa06931b343bf706e9fe2 (tree)
Time2018-04-08 13:16:39
Authormasakih <masakih@user...>
Commitermasakih

Log Message

carthageが必要かのチェックメソッドを追加

Change Summary

Incremental Difference

--- a/AppBuilderWithGit/Carthage.swift
+++ b/AppBuilderWithGit/Carthage.swift
@@ -15,34 +15,59 @@ final class Carthage {
1515 init(_ url: URL) {
1616
1717 self.baseURL = url
18+ }
19+
20+ private var cartfileURL: URL? {
21+
22+ return findFile(pattern: "Cartfile$", in: baseURL)
23+ }
24+
25+ private var carthageURL: URL? {
26+
27+ return commandPath("carthage")
28+ }
29+
30+ func checkCarthage() -> Bool {
1831
19- print("setting base url is", baseURL)
32+ guard cartfileURL != nil else {
33+
34+ return false
35+ }
36+
37+ guard carthageURL != nil else {
38+
39+ return false
40+ }
41+
42+ return true
2043 }
2144
2245 func execute() {
2346
24- guard let cartfile = findFile(pattern: "Cartfile$", in: baseURL) else {
47+ guard let cartfile = cartfileURL else {
2548
26- print("Cartfile notFound")
2749 return
2850 }
2951
30- guard let carthageURL = commandPath("carthage") else {
52+ guard let carthageURL = carthageURL else {
3153
32- print("carthage not found")
3354 return
3455 }
35- print("carthage", carthageURL)
56+
57+ let log = LogStocker("carthage")
3658
3759 let carthage = Process() <<< carthageURL.path <<< ["update"]
3860 carthage.currentDirectoryPath = cartfile.deletingLastPathComponent().path
3961
40- carthage.launch()
62+ carthage >>> { output, error in
63+ log?.write(output.data)
64+ log?.write(error.data)
65+ }
4166 carthage.waitUntilExit()
4267
4368 if carthage.terminationStatus != 0 {
4469
45- print("Carthage error")
70+ log?.write("Carthage error exit with status \(carthage.terminationStatus)")
4671 }
4772 }
4873 }