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

possible fix for #910 #911

Merged
merged 6 commits into from
Jul 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/nimblepkg/publish.nim
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,17 @@ proc publish*(p: PackageInfo, o: Options) =
if url.endsWith(".git"): url.setLen(url.len - 4)
downloadMethod = "git"
let parsed = parseUri(url)

if parsed.scheme == "":
# Assuming that we got an ssh write/read URL.
let sshUrl = parseUri("ssh://" & url)
url = "https://" & sshUrl.hostname & "/" & sshUrl.port & sshUrl.path
elif parsed.username != "" or parsed.password != "":
# check for any confidential information
dom96 marked this conversation as resolved.
Show resolved Hide resolved
# TODO: Use raiseNimbleError(msg, hintMsg) here
raise newException(NimbleError,
"Cannot publish the repository URL because it contains username and/or password. Fix the remote URL. Hint: \"git remote -v\"")

elif dirExists(os.getCurrentDir() / ".hg"):
downloadMethod = "hg"
# TODO: Retrieve URL from hg.
Expand Down