-
Notifications
You must be signed in to change notification settings - Fork 170
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
Comments
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]
----------------- |
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 |
Hello,
Thank you for the quick response!
I will set up some tests with the actual code during the week so you can see for yourself.
Thank you!
… On Feb 18, 2018, at 2:46 PM, Kyle Fuller ***@***.***> wrote:
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.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hello!
Here is the code itself:
pathString: "/Users/christophe/Programmation/Projects/Codewars/Codewars.xcodeproj/"
this path is initialized into a Path object here: Path(pathString)
then the pod simply globs it,
let pbxprojPaths = path.glob("*.pbxproj »)
this function is called:
public func glob(_ pattern: String) -> [Path] {
return Path.glob((self + pattern).description)
}
and the output if I print the results in the console are the following:
Printing description of pbxprojPaths:
▿ 1 element
▿ 0 : /
- path : "/"
- fileSystemInfo : Analyzer.DefaultFileSystemInfo()
if you need more, you could get the pod xcproj and set it up this way:
let projectRAW = try? XcodeProj(pathString: "/Users/<#name#>/<#path#>/Test.xcodeproj/")
guard let project = projectRAW else {
error("<\(code)> Could not initialize project")
exit(EXIT_FAILURE)
}
my project is in the Cross-Platform section, the Empty template. I then added to it a Command-Line target.
My program downloads a web-page and fills in some info in a .swift file which I would like to automatically add to my project and target. I have reported the error to xcproj’s GitHub.
Thanks a lot!
Christophe Bronner
… On Feb 18, 2018, at 2:46 PM, Kyle Fuller ***@***.***> wrote:
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.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#46 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ARttD2WPqPFwj1_-wM6tu-wEgX6rPlnPks5tWH4hgaJpZM4SJytS>.
|
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)
The text was updated successfully, but these errors were encountered: