• 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

Revisión9f7b703981acfa772bcd08e409d437665ccc2ab5 (tree)
Tiempo2018-04-07 00:46:47
Autormasakih <masakih@user...>
Commitermasakih

Log Message

ProcessExtensionを使用するように変更

Cambiar Resumen

Diferencia incremental

--- a/AppBuilderWithGit/Git.swift
+++ b/AppBuilderWithGit/Git.swift
@@ -87,30 +87,26 @@ final class Git {
8787 throw GitError.other("URL is invalid")
8888 }
8989
90- let git = Process()
91- git.launchPath = gitURL.path
92- git.arguments = args
90+ let git = Process() <<< gitURL.path <<< args
9391
9492 git.currentDirectoryPath = workingURL.path
9593
96- let pipe = Pipe()
97- git.standardError = pipe
98-
99- let logPipe = Pipe()
100- git.standardOutput = logPipe
101- git.standardError = logPipe
102- let log = LogStocker("git-" + args[0] + ".log")
103- log?.read(logPipe.fileHandleForReading)
94+ let errorString = git >>> { (stdout, stderr) -> String in
95+
96+ let log = LogStocker("git-" + args[0] + ".log")
97+ log?.write(stdout.data)
98+
99+ let errorString = stderr.string
100+ errorString.map { log?.write($0) }
101+
102+ return errorString ?? ""
103+ }
104104
105- git.launch()
106105 git.waitUntilExit()
107106
108107 guard git.terminationStatus == 0 else {
109108
110- let data = pipe.fileHandleForReading.readDataToEndOfFile()
111- let string = String(data: data, encoding: .utf8) ?? ""
112-
113- throw GitError.gitError(git.terminationStatus, string)
109+ throw GitError.gitError(git.terminationStatus, errorString)
114110 }
115111
116112 }