Split the DNX_HOME environment variable when it is a semi-colon separated list
This commit is contained in:
parent
06e895b7b6
commit
a198ae39cc
|
|
@ -25,10 +25,19 @@ namespace Microsoft.AspNet.Server.Kestrel.LibuvCopier
|
|||
{
|
||||
var dnxFolder = Environment.GetEnvironmentVariable("DNX_HOME");
|
||||
|
||||
if (string.IsNullOrEmpty(dnxFolder))
|
||||
var firstCandidate = dnxFolder?.Split(';')
|
||||
?.Select(path => Environment.ExpandEnvironmentVariables(path))
|
||||
?.Where(path => Directory.Exists(path))
|
||||
?.FirstOrDefault();
|
||||
|
||||
if (string.IsNullOrEmpty(firstCandidate))
|
||||
{
|
||||
dnxFolder = Path.Combine(GetHome(), ".dnx");
|
||||
}
|
||||
else
|
||||
{
|
||||
dnxFolder = firstCandidate;
|
||||
}
|
||||
|
||||
packagesFolder = Path.Combine(dnxFolder, "packages");
|
||||
}
|
||||
|
|
@ -50,7 +59,7 @@ namespace Microsoft.AspNet.Server.Kestrel.LibuvCopier
|
|||
}
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
throw;
|
||||
|
|
|
|||
Loading…
Reference in New Issue