Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Escape all sources when they need it #967

Merged
merged 1 commit into from
May 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions NuKeeper.Abstractions/NuGet/NuGetSources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public NuGetSources(IEnumerable<PackageSource> sources)
public string CommandLine(string prefix)
{
return Items
.Select(s => $"{prefix} {EscapePathIfLocal(s)}")
.Select(s => $"{prefix} {EscapeSource(s)}")
.JoinWithSeparator(" ");
}

Expand All @@ -54,9 +54,9 @@ public override string ToString()
return Items.Select(s => s.SourceUri.ToString()).JoinWithCommas();
}

private static string EscapePathIfLocal(PackageSource source)
private static string EscapeSource(PackageSource source)
{
return source.IsLocal ? ArgumentEscaper.EscapeAndConcatenate(new[] { source.Source }) : source.Source;
return ArgumentEscaper.EscapeAndConcatenate(new[] { source.Source });
}
}
}