extract IsInteractive to separate method
This commit is contained in:
parent
e8b9a44489
commit
db9f9dfa6e
1 changed files with 12 additions and 12 deletions
|
@ -20,38 +20,38 @@ namespace Microsoft.DotNet.Tools.Run
|
|||
public string Project = null;
|
||||
public IReadOnlyList<string> Args = null;
|
||||
|
||||
bool _isInteractive = false;
|
||||
ProjectContext _context;
|
||||
List<string> _args;
|
||||
|
||||
public int Start()
|
||||
{
|
||||
CalculateDefaultsForNonAssigned();
|
||||
|
||||
if (_isInteractive)
|
||||
if (IsInteractive())
|
||||
{
|
||||
return RunInteractive(Project);
|
||||
}
|
||||
else
|
||||
{
|
||||
CalculateDefaultsForNonAssigned();
|
||||
return RunExecutable();
|
||||
}
|
||||
}
|
||||
|
||||
private void CalculateDefaultsForNonAssigned()
|
||||
private bool IsInteractive()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Project))
|
||||
{
|
||||
if (File.Exists(Project) && (Path.GetExtension(Project) == ".csx"))
|
||||
if (File.Exists(Project) && (Path.GetExtension(Project).ToLowerInvariant() == ".csx"))
|
||||
{
|
||||
_isInteractive = true;
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Project = Directory.GetCurrentDirectory();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void CalculateDefaultsForNonAssigned()
|
||||
{
|
||||
Project = Directory.GetCurrentDirectory();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Configuration))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue