Skip to content

Commit

Permalink
Print user-friendly DOCUMENTER_KEY decode error
Browse files Browse the repository at this point in the history
Closes #697.
  • Loading branch information
mortenpi committed Dec 10, 2018
1 parent 5ac18c9 commit 23a6a7e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Documenter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -547,13 +547,22 @@ function git_push(
dirname = isempty(dirname) ? temp : joinpath(temp, dirname)
isdir(dirname) || mkpath(dirname)

keyfile = abspath(joinpath(root, ".documenter"))
target_dir = abspath(target)

# The upstream URL to which we push new content and the ssh decryption commands.
upstream = "git@$(replace(repo, "github.com/" => "github.com:"))"

write(keyfile, String(base64decode(key)))
keyfile = abspath(joinpath(root, ".documenter"))
try
write(keyfile, String(base64decode(key)))
catch e
@error """
Documenter failed to decode the DOCUMENTER_KEY environment variable.
Make sure that the environment variable is properly set up as a Base64-encoded string
of the SSH private key. You may need to re-generate the keys with DocumenterTools.
"""
rethrow(e)
end
chmod(keyfile, 0o600)

try
Expand Down

0 comments on commit 23a6a7e

Please sign in to comment.