Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/NuGet.BuildTasks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Köplinger <alex.koeplinger@outlook.com>2016-03-18 21:17:08 +0300
committerAlexander Köplinger <alex.koeplinger@outlook.com>2016-03-18 21:17:08 +0300
commit9be7c85bb1992be5a50640169f4f68a6126b3379 (patch)
treef0edd3f540220c3f766cc9bfb0bf90fe7d321d01
parentb8552204ff93245bb6e36ff9a4cb6091d05a7b94 (diff)
Use Path.DirectorySeparatorChar instead of hardcoding backslash
This allows using the code on Unix filesystems that use forward slash.
-rw-r--r--src/Microsoft.NuGet.Build.Tasks/NuGetPackageObject.cs2
-rw-r--r--src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/Microsoft.NuGet.Build.Tasks/NuGetPackageObject.cs b/src/Microsoft.NuGet.Build.Tasks/NuGetPackageObject.cs
index b6fb6fc..4d46c12 100644
--- a/src/Microsoft.NuGet.Build.Tasks/NuGetPackageObject.cs
+++ b/src/Microsoft.NuGet.Build.Tasks/NuGetPackageObject.cs
@@ -49,7 +49,7 @@ namespace Microsoft.NuGet.Build.Tasks
public string GetFullPathToFile(string relativePath)
{
- relativePath = relativePath.Replace('/', '\\');
+ relativePath = relativePath.Replace('/', Path.DirectorySeparatorChar);
return Path.Combine(_fullPackagePath.Value, relativePath);
}
}
diff --git a/src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs b/src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs
index 7fa59f7..963e8d8 100644
--- a/src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs
+++ b/src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs
@@ -461,7 +461,7 @@ namespace Microsoft.NuGet.Build.Tasks
private string GetPath(string packageName, string packageVersion, string file)
{
- return Path.Combine(GetNuGetPackagePath(packageName, packageVersion), file.Replace('/', '\\'));
+ return Path.Combine(GetNuGetPackagePath(packageName, packageVersion), file.Replace('/', Path.DirectorySeparatorChar));
}
/// <summary>
@@ -819,7 +819,7 @@ namespace Microsoft.NuGet.Build.Tasks
if (!string.IsNullOrEmpty(destinationSubDirectory))
{
- item.SetMetadata("DestinationSubDirectory", destinationSubDirectory + "\\");
+ item.SetMetadata("DestinationSubDirectory", destinationSubDirectory + Path.DirectorySeparatorChar);
}
}