Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glob function issue #46

Open
Lancelotbronner opened this issue Feb 18, 2018 · 4 comments
Open

Glob function issue #46

Lancelotbronner opened this issue Feb 18, 2018 · 4 comments

Comments

@Lancelotbronner
Copy link

Context

I am using macOS High Sierra v10.13.3. Using with framework xcproj.

What

So there is this path to an xcodeproj (valid, I checked) and xcproj uses the glob function to find the project.pbxproj in it.
let pbxprojPaths = path.glob("*.pbxproj")

This only returns one path (good)
with the url being "/" (bad)

@kylef
Copy link
Owner

kylef commented Feb 18, 2018

Hi @Lancelotbronner, I've modified the tests in the project to perform a similar glob which appears to be working for me. Are you doing anything much different from the diff below?

diff --git a/Tests/PathKitTests/XCTest.swift b/Tests/PathKitTests/XCTest.swift
index 6d6fee2..5a33a1d 100644
--- a/Tests/PathKitTests/XCTest.swift
+++ b/Tests/PathKitTests/XCTest.swift
@@ -1,7 +1,16 @@
 import XCTest
+import PathKit
 
 class PathKitTests: XCTestCase {
   func testRunSpectre() {
     testPathKit()
   }
+
+  func testXcodeProj() {
+    print("-----------------")
+    let path = Path("/Users/kyle/Projects/kylef/palaver-ios/Palaver.xcodeproj")
+    print(path)
+    print(path.glob("*.pbxproj"))
+    print("-----------------")
+  }
 }
-----------------
/Users/kyle/Projects/kylef/palaver-ios/Palaver.xcodeproj
[/Users/kyle/Projects/kylef/palaver-ios/Palaver.xcodeproj/project.pbxproj]
-----------------

@kylef
Copy link
Owner

kylef commented Feb 18, 2018

Perhaps you could create a test case in PathKit which could show the broken behaviour? Although PathKit isn't doing much more than the system glob method that PathKit is using so it would be worth adding breakpoints to the glob method and see what is going on in your case.

@Lancelotbronner
Copy link
Author

Lancelotbronner commented Feb 19, 2018 via email

@Lancelotbronner
Copy link
Author

Lancelotbronner commented Feb 24, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants