-
-
Notifications
You must be signed in to change notification settings - Fork 11
Fix path detection when Build appears in directory names #40
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -39,7 +39,13 @@ struct AckGen: ParsableCommand { | |||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| let plistPath: String = output ?? "\(srcRoot)/Acknowledgements.plist" | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| let packageCachePath = tempDirPath.components(separatedBy: "/Build/")[0] + "/SourcePackages/checkouts" | ||||||||||||||||||||||||||||
| // Find the last occurrence of "/Build/" to handle edge cases like "Build" in username | ||||||||||||||||||||||||||||
| let packageCachePath: String | ||||||||||||||||||||||||||||
| if let range = tempDirPath.range(of: "/Build/", options: .backwards) { | ||||||||||||||||||||||||||||
| packageCachePath = String(tempDirPath[..<range.lowerBound]) + "/SourcePackages/checkouts" | ||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||
| packageCachePath = tempDirPath.components(separatedBy: "/Build/")[0] + "/SourcePackages/checkouts" | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
Comment on lines
+43
to
+48
|
||||||||||||||||||||||||||||
| let packageCachePath: String | |
| if let range = tempDirPath.range(of: "/Build/", options: .backwards) { | |
| packageCachePath = String(tempDirPath[..<range.lowerBound]) + "/SourcePackages/checkouts" | |
| } else { | |
| packageCachePath = tempDirPath.components(separatedBy: "/Build/")[0] + "/SourcePackages/checkouts" | |
| } | |
| let basePath: String | |
| if let range = tempDirPath.range(of: "/Build/", options: .backwards) { | |
| basePath = String(tempDirPath[..<range.lowerBound]) | |
| } else { | |
| basePath = tempDirPath | |
| } | |
| let packageCachePath = basePath + "/SourcePackages/checkouts" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this shell snippet
SDKROOT=$(...)only sets a shell variable; it is not exported, soswift run ackgenwill not seeSDKROOTin its environment. If the intent is to force the macOS SDK for the child process, export it (or set it inline on theswift runinvocation); otherwise consider removing the line to avoid implying it has an effect.