     cmd = [
       "cp",
       name,
-      "/nerves/host/artifacts/#{name}"]
+      "/nerves/dl/#{name}"]
 
     run(pkg, cmd, stream)
-    path = Path.join(name, Nerves.Env.download_dir())
+    path = Artifact.download_path(pkg)
     {:ok, path}
   end
 

      "/nerves/env/platform/create-build.sh #{defconfig} #{@working_dir} >/dev/null",
    ]
    mounts = Enum.join(mounts(pkg), " ")
    Mix.Nerves.Shell.open("docker run --rm -it -w #{@working_dir} #{mounts} #{image}", initial_input)
  end

  defp preflight(pkg) do

    Mix.shell.info("\n")
    :ok = make_artifact(pkg, stream)
    Mix.shell.info("\n")
    {:ok, path} = copy_artifact(pkg, stream)
    Mix.shell.info("\n")
    _ = Nerves.Utils.Stream.stop(pid)
    {:ok, path}
