Skip to content

Commit 7e62d74

Browse files
Merge pull request #744 from jimmylewis/232
Use forward slash for CLI install suggested path
2 parents 8ba77a6 + 2db9990 commit 7e62d74

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/libman/Commands/InstallCommand.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ protected override async Task<int> ExecuteInternalAsync()
119119
InstallDestination = Destination.HasValue() ? Destination.Value() : _manifest.DefaultDestination;
120120
if (string.IsNullOrWhiteSpace(InstallDestination))
121121
{
122-
string destinationHint = Path.Combine(Settings.DefaultDestinationRoot, ProviderToUse.GetSuggestedDestination(library));
122+
string destinationHint = string.Join('/', Settings.DefaultDestinationRoot, ProviderToUse.GetSuggestedDestination(library));
123123
InstallDestination = GetUserInputWithDefault(
124124
fieldName: nameof(Destination),
125125
defaultFieldValue: destinationHint,
@@ -132,6 +132,12 @@ protected override async Task<int> ExecuteInternalAsync()
132132
destinationToUse = InstallDestination;
133133
}
134134

135+
if (destinationToUse is not null)
136+
{
137+
// in case the user changed the suggested default, normalize separator to /
138+
destinationToUse = destinationToUse.Replace('\\', '/');
139+
}
140+
135141
ILibraryOperationResult result = await _manifest.InstallLibraryAsync(
136142
library.Name,
137143
library.Version,

0 commit comments

Comments
 (0)