-
Notifications
You must be signed in to change notification settings - Fork 15
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
Nulls in link #29
Comments
I'm also getting nulls in the URL, which in my case I think is related to having I looked a bit at the regex in https://github.com/kawamataryo/copy-git-link/blob/main/src/main/kotlin/com/github/kawamataryo/copygitlink/utils/utils.kt#L41 and it seems like you could simplify things by just grabbing everything after the host & port and then removing any fun getRepositoryPathFromRemoteUrl(
remoteUrl: String,
): String {
val result =
Regex(".*(?:@|//)(.[^:/]*)(:?:[0-9]{1,4})?(.*)\$").matchEntire(
remoteUrl
)
val path = result?.groupValues?.get(3)?.removeSuffix(".git") ?: ""
return result?.groupValues?.get(1) + result?.groupValues?.get(2) + "/" + path
} I don't have a kotlin environment set up on this machine, but if you like I could make a little PR to that effect this weekend. |
In new IDEA version it generates URL with nulls instead of some critical URL parts:
https://nullnull/null/blob/147b777baa25147742e85e1b9242051efe354e9f/GlipBot.postman_collection.json#L3
The text was updated successfully, but these errors were encountered: