Skip to content

Commit

Permalink
Trivial: Clean up temporary variable in Dub.fetch
Browse files Browse the repository at this point in the history
And improve the message displayed to users.
  • Loading branch information
Geod24 authored and dlang-bot committed Jan 22, 2024
1 parent 6a6ab4b commit 9d99061
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions source/dub/dub.d
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,6 @@ class Dub {
Package fetch(in PackageName name, in VersionRange range, FetchOptions options,
PlacementLocation location, string reason = "")
{
auto basePackageName = name.main;
Json pinfo;
PackageSupplier supplier;
foreach(ps; m_packageSuppliers){
Expand All @@ -994,7 +993,7 @@ class Dub {
if (existing && existing.version_ != ver)
logInfo("A new version for %s is available (%s -> %s). Run \"%s\" to switch.",
name.toString().color(Mode.bold), existing, ver,
text("dub upgrade ", name).color(Mode.bold));
text("dub upgrade ", name.main).color(Mode.bold));
return null;
}

Expand Down Expand Up @@ -1023,7 +1022,7 @@ class Dub {
{
import std.zip : ZipException;

auto path = getTempFile(basePackageName.toString(), ".zip");
auto path = getTempFile(name.main.toString(), ".zip");
supplier.fetchPackage(path, name.main, range, (options & FetchOptions.usePrerelease) != 0); // Q: continue on fail?
scope(exit) removeFile(path);
logDiagnostic("Placing to %s...", location.toString());
Expand Down

0 comments on commit 9d99061

Please sign in to comment.