-
Notifications
You must be signed in to change notification settings - Fork 66
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
Buildasaur doesn't extract repo name from GitHub url that does not end in ".git" #244
Comments
Hi @lindsaylandry, thanks for reporting this. I'm however wondering whether a git remote URL not ending with |
Ok, TIL that you don't need the Thanks so much for reporting this! Could you fork this repo and send a Pull Request with the fix above, so that I can just merge it? If that's a problem, I can apply the fix manually. |
Any git repo can be cloned in this way. git clone git@github.com:czechboy0/Buildasaur if you leave the .git extension out, it still works. |
You can just create a fork of the repository if you click on the fork button top right, clone and apply the fix there, and then create a cross-fork Pull Request :) If you haven't worked with forks before, here's some info from github. |
oh thanks very much, looks like I learned something today as well. |
Fixed by #246. |
Sometimes github strings do not have ".git" attached to the end.
If this happens, Buildasaur will give an error message on the SSH Keys setup page. The message says: "Invalid repo name."
Example github string (without ".git"):
git@github.com:organization/repo_name
I have a fix that will address both kinds of strings to extract the repo name (basically creates a Range object that starts and ends at the end of the string if it cannot find ".git")
Project.swift.zip
Buildasaur/BuildaKit/Project.swift
Replace the following lines:
- if let githubRange = stringUrl.rangeOfString(serviceUrl, options: NSStringCompareOptions(), range: nil, locale: nil),
- let dotGitRange = stringUrl.rangeOfString(".git", options: NSStringCompareOptions.BackwardsSearch, range: nil, locale: nil) {
+ let dotGitRange = stringUrl.rangeOfString(".git", options: NSStringCompareOptions.BackwardsSearch, range: nil, locale: nil) ?? Range(start: stringUrl.endIndex, end: stringUrl.endIndex)
+ if let githubRange = stringUrl.rangeOfString(serviceUrl, options: NSStringCompareOptions(), range: nil, locale: nil){
The text was updated successfully, but these errors were encountered: