Skip to content

Commit

Permalink
Dub: Use removeFile instead of std.file.remove (#2516)
Browse files Browse the repository at this point in the history
In the end it calls the same function, but this allow us
to consistently inject dependencies.
  • Loading branch information
Geod24 authored Oct 28, 2022
1 parent 68bd514 commit 14568dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/dub/dub.d
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ class Dub {
// TODO: clear target files and copy files

if (existsFile(path ~ ".dub/build")) rmdirRecurse((path ~ ".dub/build").toNativeString());
if (existsFile(path ~ ".dub/metadata_cache.json")) std.file.remove((path ~ ".dub/metadata_cache.json").toNativeString());
if (existsFile(path ~ ".dub/metadata_cache.json")) removeFile((path ~ ".dub/metadata_cache.json"));

auto p = Package.load(path);
if (p.getBuildSettings().targetType == TargetType.none) {
Expand Down Expand Up @@ -869,7 +869,7 @@ class Dub {

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

try {
Expand Down

0 comments on commit 14568dc

Please sign in to comment.