fix error with project being erased and move getdefaults call to execute function

This commit is contained in:
Krzysztof Wicher 2015-11-23 19:58:11 -08:00
parent db9f9dfa6e
commit cc527abc7c

View file

@ -31,7 +31,6 @@ namespace Microsoft.DotNet.Tools.Run
} }
else else
{ {
CalculateDefaultsForNonAssigned();
return RunExecutable(); return RunExecutable();
} }
} }
@ -51,7 +50,10 @@ namespace Microsoft.DotNet.Tools.Run
private void CalculateDefaultsForNonAssigned() private void CalculateDefaultsForNonAssigned()
{ {
Project = Directory.GetCurrentDirectory(); if (string.IsNullOrWhiteSpace(Project))
{
Project = Directory.GetCurrentDirectory();
}
if (string.IsNullOrWhiteSpace(Configuration)) if (string.IsNullOrWhiteSpace(Configuration))
{ {
@ -81,6 +83,8 @@ namespace Microsoft.DotNet.Tools.Run
private int RunExecutable() private int RunExecutable()
{ {
CalculateDefaultsForNonAssigned();
// Create a temporary directory // Create a temporary directory
var tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")); var tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));