• 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ón81e90367cee925935df142fc7e2f11dfdfbcebdd (tree)
Tiempo2018-04-08 11:58:29
Autormasakih <masakih@user...>
Commitermasakih

Log Message

コマンドが正しく見つけられなかったので修正

暫定版

Cambiar Resumen

Diferencia incremental

--- a/AppBuilderWithGit/CommandFinder.swift
+++ b/AppBuilderWithGit/CommandFinder.swift
@@ -13,3 +13,27 @@ func existCommand(_ commandName: String) -> Bool {
1313 return Process() <<< "/usr/bin/which" <<< [commandName]
1414 >>> { output in output.lines.count == 2 }
1515 }
16+
17+func commandPath(_ commandName: String) -> URL? {
18+
19+ let which = Process() <<< "/usr/bin/which" <<< [commandName]
20+ if let currentPath = which.environment?["PATH"] {
21+
22+ print(currentPath)
23+ which.environment!["PATH"] = "/usr/local/bin/:" + currentPath
24+ } else {
25+ which.environment = ["PATH": "/bin:/sbin:/local/bin:/local/sbin:/usr/local/bin"]
26+ }
27+ return which >>> { (output: Output) -> URL? in
28+
29+ let lines = output.lines
30+
31+ print(lines)
32+
33+ guard let path = lines.first else {
34+ return nil
35+ }
36+
37+ return URL(fileURLWithPath: path)
38+ }
39+}
--- a/AppBuilderWithGitTests/AppBuilderWithGitTests.swift
+++ b/AppBuilderWithGitTests/AppBuilderWithGitTests.swift
@@ -19,6 +19,11 @@ class AppBuilderWithGitTests: XCTestCase {
1919 XCTAssertFalse(existCommand("skjdlfkjsaldfjalkj"))
2020 }
2121
22+ func testCommandPath() {
23+
24+ XCTAssertEqual(commandPath("carthage")?.path, "/usr/local/bin/carthage")
25+ XCTAssertEqual(commandPath("pod")?.path, "/usr/local/bin/pod")
26+ }
2227
2328 func testMatch() {
2429
@@ -45,7 +50,6 @@ class AppBuilderWithGitTests: XCTestCase {
4550 XCTAssertNotNil(findFile(pattern: "PkgInfo", in: bundleURL, depth: 3))
4651
4752 XCTAssertNil(findFile(pattern: "pkgInfo", in: bundleURL, depth: 3))
48-
4953
5054 }
5155 }