Skip to content

Commit

Permalink
Refactor usage of dubInfos
Browse files Browse the repository at this point in the history
  • Loading branch information
atilaneves committed Aug 11, 2023
1 parent 48e01df commit 3944ac0
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/reggae/dub/interop/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,7 @@ void writeDubConfig(O)(ref O output,
return;
}

// must check for dub.selections.json before creating dub instance
const dubSelectionsJson = ensureDubSelectionsJson(output, options);

auto dub = Dub(options);

dubFetch(output, dub, options, dubSelectionsJson);

output.log(" Getting dub build information");
auto dubInfos = getDubInfos(output, dub, options);
output.log(" Got dub build information");
auto dubInfos = dubInfos(output, options);

const targetType = dubInfos["default"].packages.length
? dubInfos["default"].packages[0].targetType
Expand All @@ -60,9 +51,16 @@ auto dubInfos(O)(ref O output,

// must check for dub.selections.json before creating dub instance
const dubSelectionsJson = ensureDubSelectionsJson(output, options);

auto dub = Dub(options);

dubFetch(output, dub, options, dubSelectionsJson);
return getDubInfos(output, dub, options);

output.log(" Getting dub build information");
auto ret = getDubInfos(output, dub, options);
output.log(" Got dub build information");

return ret;
}

private string ensureDubSelectionsJson
Expand Down

0 comments on commit 3944ac0

Please sign in to comment.