Using a path from `DNX_PACKAGES` if defined
This commit is contained in:
parent
d2f282f54f
commit
e47192b9e9
|
|
@ -10,6 +10,10 @@ namespace Microsoft.AspNet.Server.Kestrel.LibuvCopier
|
|||
public void Main(string[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
var packagesFolder = Environment.GetEnvironmentVariable("DNX_PACKAGES");
|
||||
|
||||
if (string.IsNullOrEmpty(packagesFolder))
|
||||
{
|
||||
var dnxFolder = Environment.GetEnvironmentVariable("DNX_HOME");
|
||||
if (string.IsNullOrEmpty(dnxFolder))
|
||||
|
|
@ -17,6 +21,9 @@ namespace Microsoft.AspNet.Server.Kestrel.LibuvCopier
|
|||
dnxFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".dnx");
|
||||
}
|
||||
|
||||
packagesFolder = Path.Combine(dnxFolder, "packages");
|
||||
}
|
||||
|
||||
var lockJson = JObject.Parse(File.ReadAllText("project.lock.json"));
|
||||
|
||||
foreach (var libuvLib in lockJson["libraries"].OfType<JProperty>().Where(
|
||||
|
|
@ -27,7 +34,7 @@ namespace Microsoft.AspNet.Server.Kestrel.LibuvCopier
|
|||
if (filePath.ToString().StartsWith("runtimes/", StringComparison.Ordinal))
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(filePath));
|
||||
File.Copy(Path.Combine(dnxFolder, "packages", libuvLib.Name, filePath), filePath, overwrite: true);
|
||||
File.Copy(Path.Combine(packagesFolder, libuvLib.Name, filePath), filePath, overwrite: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue