masakih

AppBuilderWithGit

  • R/O
  • HTTP
  • SSH
  • HTTPS

コミット

よく使われているワード(クリックで追加)

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

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


コミットメタ情報

リビジョン24154346da19c368b15fe19b456d1004d43a6e57 (tree)
日時2018-04-08 13:15:11
作者masakih <masakih@user...>
コミッターmasakih

ログメッセージ

無用な出力を削除

変更サマリ

差分

--- a/AppBuilderWithGit/CommandFinder.swift
+++ b/AppBuilderWithGit/CommandFinder.swift
@@ -10,26 +10,37 @@ import Foundation
1010
1111 func existCommand(_ commandName: String) -> Bool {
1212
13- return Process() <<< "/usr/bin/which" <<< [commandName]
14- >>> { output in output.lines.count == 2 }
13+ let which = Process() <<< "/usr/bin/which" <<< [commandName]
14+
15+ if let currentPath = which.environment?["PATH"] {
16+
17+ which.environment!["PATH"] = "/usr/local/bin/:" + currentPath
18+
19+ } else {
20+
21+ which.environment = ["PATH": "/bin:/sbin:/local/bin:/local/sbin:/usr/local/bin"]
22+ }
23+
24+ return which >>> { output in output.lines.count == 2 }
1525 }
1626
1727 func commandPath(_ commandName: String) -> URL? {
1828
1929 let which = Process() <<< "/usr/bin/which" <<< [commandName]
30+
2031 if let currentPath = which.environment?["PATH"] {
2132
22- print(currentPath)
2333 which.environment!["PATH"] = "/usr/local/bin/:" + currentPath
34+
2435 } else {
36+
2537 which.environment = ["PATH": "/bin:/sbin:/local/bin:/local/sbin:/usr/local/bin"]
2638 }
39+
2740 return which >>> { (output: Output) -> URL? in
2841
2942 let lines = output.lines
30-
31- print(lines)
32-
43+
3344 guard let path = lines.first else {
3445 return nil
3546 }