aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Console/ConsoleExecutionEngine.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-03-15 01:55:42 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-03-15 01:55:42 +0200
commit96fe20a20e7c107473cefeda3b06950955952bec (patch)
tree0c7efeb2a332eabdab4a551734eb94f4828aa381 /Software/Visual_Studio/Tango.Console/ConsoleExecutionEngine.cs
parentbb82e09c0080cacec65512805ac88f6b3416c3f2 (diff)
downloadTango-96fe20a20e7c107473cefeda3b06950955952bec.tar.gz
Tango-96fe20a20e7c107473cefeda3b06950955952bec.zip
Improved Console.
Increased SignalR adapter connect timeout. Implemented Tango.FileSystem !!!
Diffstat (limited to 'Software/Visual_Studio/Tango.Console/ConsoleExecutionEngine.cs')
-rw-r--r--Software/Visual_Studio/Tango.Console/ConsoleExecutionEngine.cs26
1 files changed, 17 insertions, 9 deletions
diff --git a/Software/Visual_Studio/Tango.Console/ConsoleExecutionEngine.cs b/Software/Visual_Studio/Tango.Console/ConsoleExecutionEngine.cs
index 42bc2ac00..02b58a658 100644
--- a/Software/Visual_Studio/Tango.Console/ConsoleExecutionEngine.cs
+++ b/Software/Visual_Studio/Tango.Console/ConsoleExecutionEngine.cs
@@ -61,7 +61,7 @@ namespace Tango.Console
}
//process.StartInfo.Verb = "runas";
- if (ConsoleDictionary.GetKnownCommands().Exists(x => x.Name.ToLower() == parsedCommand.Command))
+ if (ConsoleDictionary.GetKnownCommands().Exists(x => x.Name.ToLower() == parsedCommand.Command.ToLower()))
{
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.Arguments = "/C " + request.Command;
@@ -93,30 +93,38 @@ namespace Tango.Console
});
}
- private ConsoleCommandExecutionResult CreateResult(String workingFolder, String output)
+ public static List<ConsoleSuggestion> GetSuggestions(String folder)
{
- ConsoleCommandExecutionResult result = new ConsoleCommandExecutionResult();
- result.WorkingFolder = workingFolder;
- result.Output = output;
+ List<ConsoleSuggestion> suggestions = new List<ConsoleSuggestion>();
- foreach (var dir in Directory.GetDirectories(Path.GetFullPath(workingFolder)))
+ foreach (var dir in Directory.GetDirectories(Path.GetFullPath(folder)))
{
- result.Suggestions.Add(new ConsoleSuggestion()
+ suggestions.Add(new ConsoleSuggestion()
{
Type = ConsoleSuggestionType.Folder,
Name = Path.GetFileName(dir)
});
}
- foreach (var file in Directory.GetFiles(Path.GetFullPath(workingFolder)))
+ foreach (var file in Directory.GetFiles(Path.GetFullPath(folder)))
{
- result.Suggestions.Add(new ConsoleSuggestion()
+ suggestions.Add(new ConsoleSuggestion()
{
Type = ConsoleSuggestionType.File,
Name = Path.GetFileName(file),
});
}
+ return suggestions;
+ }
+
+ private ConsoleCommandExecutionResult CreateResult(String workingFolder, String output)
+ {
+ ConsoleCommandExecutionResult result = new ConsoleCommandExecutionResult();
+ result.WorkingFolder = workingFolder;
+ result.Output = output;
+ result.Suggestions.AddRange(GetSuggestions(workingFolder));
+
return result;
}
}