Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #71 from ma2gedev/puts_hex_package_url
puts a hex.pm package url after published
  • Loading branch information
ericmj committed Dec 15, 2014
2 parents 2fa78b7 + 590df6d commit c5c3787
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/hex/util.ex
Expand Up @@ -188,6 +188,10 @@ defmodule Hex.Util do
defp indent(0), do: " "
defp indent(depth), do: " " <> indent(depth - 1)

def hex_package_url(package, version) do
"#{Hex.url}/packages/#{package}/#{version}"
end

def hexdocs_url(package, version) do
"http://hexdocs.pm/#{package}/#{version}/"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/mix/tasks/hex/publish.ex
Expand Up @@ -178,7 +178,7 @@ defmodule Mix.Tasks.Hex.Publish do
case Hex.API.Release.new(meta[:name], tarball, auth, progress) do
{code, _} when code in 200..299 ->
Mix.shell.info("")
Mix.shell.info("Published #{meta[:name]} v#{meta[:version]}")
Mix.shell.info("Published at #{Hex.Util.hex_package_url(meta[:name], meta[:version])}")
Mix.shell.info("Don't forget to upload your documentation with `mix hex.docs`")
{code, body} ->
Mix.shell.error("Pushing #{meta[:name]} v#{meta[:version]} failed (#{code})")
Expand Down

0 comments on commit c5c3787

Please sign in to comment.