Skip to content

Commit 481dbe9

Browse files
committed
workaround msbuild bug dotnet/msbuild#3268
fix nuget feed urls if needed (msbuild pass `http:/` instead of `http://`)
1 parent 1a91630 commit 481dbe9

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/Paket.Bootstrapper.preview3/Paket.Bootstrapper.preview3.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
NO_SYSTEMWEBPROXY;
1414
PAKET_BOOTSTRAP_AS_TOOL;
1515
PAKET_BOOTSTRAP_TO_DIR;
16+
PAKET_BOOTSTRAP_WORKAROUND_MSBUILD_URLS;
1617
$(DefineConstants)
1718
</DefineConstants>
1819
</PropertyGroup>

src/Paket.Bootstrapper/ArgumentParser.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,20 @@ public static BootstrapperOptions ParseArgumentsAndConfigurations(IEnumerable<st
127127
options.Verbosity = Verbosity.Trace;
128128
}
129129

130+
#if PAKET_BOOTSTRAP_WORKAROUND_MSBUILD_URLS
131+
if (!String.IsNullOrEmpty(options.DownloadArguments.NugetSource)) {
132+
string url = options.DownloadArguments.NugetSource;
133+
string fixedUrl;
134+
if (url.StartsWith("http://") || url.StartsWith("https://")) {
135+
fixedUrl = url;
136+
}
137+
else {
138+
fixedUrl = url.Replace("http:/", "http://").Replace("https:/", "https://");
139+
}
140+
options.DownloadArguments.NugetSource = fixedUrl;
141+
}
142+
#endif
143+
130144
return options;
131145
}
132146

0 commit comments

Comments
 (0)