                   "the --unused option cleans unused dependencies"
     end
 
-    do_clean(apps_to_clean, build, deps, opts[:build])
+    do_clean(apps_to_clean, loaded_deps, build_path, deps_path, opts[:build])
 
     if opts[:unlock] do
       Mix.Task.run "deps.unlock", args

    end
  end

  defp checked_deps(build, deps) do
    for root <- [deps, build],
        path <- Path.wildcard(Path.join(root, "*")),
        File.dir?(path) do
      Path.basename(path)

  can only happen by passing arguments/options:

    * `dep1, dep2` - the name of dependencies to be deleted
    * `--unlock`   - also unlocks the deleted dependencies
    * `--build`    - deletes only compiled files (keeps source files)
    * `--all`      - deletes all dependencies
    * `--unused`   - deletes only unused dependencies
      (i.e. dependencies no longer mentioned in `mix.exs` are removed)

  By default this task works across all environments,
  unless `--only` is given which will clean all dependencies
  leaving only the ones for chosen environment.
  """

  @switches [unlock: :boolean, all: :boolean, only: :string, unused: :boolean,
