   @spec get_release_versions(String.t) :: list(String.t)
   def get_release_versions(output_dir) do
     releases_path = Path.join([output_dir, "releases"])
-    case File.exists?(releases_path) do
-      false -> []
-      true  ->
-        releases_path
-        |> File.ls!
-        |> Enum.filter(&Regex.match?(@valid_version_pattern, &1))
-        |> sort_versions
+    if File.exists?(releases_path) do
+      releases_path
+      |> File.ls!
+      |> Enum.filter(&Regex.match?(@valid_version_pattern, &1))
+      |> sort_versions
+    else
+      []
     end
   end
 

  defp get_apps(nil, acc), do: Enum.uniq(acc)
  defp get_apps({:error, _} = err, _acc), do: err
  defp get_apps(%App{} = app, acc) do
    new_acc = app.applications
    |> Enum.concat(app.included_applications)
    |> Enum.reduce([app|acc], fn
      {:error, _} = err, _acc ->
        err
      {a, load_type}, acc ->
        case Enum.any?(acc, fn %App{name: ^a} -> true; _ -> false end) do
          true -> acc
          false ->
            case App.new(a, load_type) do
              nil ->
                acc
              %App{} = app ->
                case get_apps(app, acc) do
                  {:error, _} = err -> err
                  children -> Enum.concat(acc, children)
                end
              {:error, _} = err ->
                err
            end
        end
      a, acc ->
        case Enum.any?(acc, fn %App{name: ^a} -> true; _ -> false end) do
          true -> acc
          false ->
            case App.new(a) do
              nil ->
                acc
              %App{} = app ->
                case get_apps(app, acc) do
                  {:error, _} = err -> err
                  children -> Enum.concat(acc, children)
                end
              {:error, _} = err ->
                err
            end
        end
    end)
    case new_acc do
      {:error, _} = err -> err
      apps -> Enum.uniq(apps)
    end
  end


  """
  @spec detect_erts_version(String.t) :: {:ok, Stringt} | {:error, term}
  def detect_erts_version(path) when is_binary(path) do
    entries =
      path
      |> Path.expand
      |> Path.join("erts-*")
      |> Path.wildcard
      |> Enum.map(&Path.basename/1)
    case entries do
      [<<"erts-", vsn::binary>>] ->
        {:ok, vsn}
