 
   ## Examples
 
-    mix release.clean       #=> Cleans release
-    mix release.clean --rel #=> Cleans release + generated tools
-    mix release.clean --all #=> Cleans absolutely everything
+    # Cleans the release for the current version of the project
+    mix release.clean
+    # Remove all files generated by exrm, including releases
+    mix release.clean --implode
 
   """
   @shortdoc "Clean up any release-related files."

      |> Enum.map(fn dir -> build |> Path.join(dir) end)
      |> Enum.map(&File.rm_rf!/1)
    end
  end
  # Clean release build + generated tools
  def do_cleanup(:rel) do
    # Execute build cleanup
    do_cleanup :build

    # Remove generated tools
    clean_relx
    rel = File.cwd! |> Path.join("rel")
    if File.exists?(rel), do: File.rm_rf!(rel)
  end
  # Clean up the template files for release generation
  def do_cleanup(:relfiles) do

  def run(args) do
    debug "Removing release files..."
    cond do
      "--implode" in args ->
        if confirm_implode? do
          do_cleanup :all
          info "All release files were removed successfully!"
        end
      true ->
        do_cleanup :build
        info "The release for #{Mix.project |> Keyword.get(:version)} has been removed."
    end
  end

  # Clean release build
  def do_cleanup(:build) do
    cwd      = File.cwd!
    project  = Mix.project |> Keyword.get(:app) |> atom_to_binary
    version  = Mix.project |> Keyword.get(:version)
    release  = cwd |> Path.join("rel")    |> Path.join(project) |> Path.join("releases") |> Path.join(version)
    build    = cwd |> Path.join("_build") |> Path.join("prod")
    if File.exists?(release), do: File.rm_rf!(release)
    if File.exists?(build) do
