Skip to content

Commit 94b64ef

Browse files
committed
Added open databae vide code editor.
1 parent d32c560 commit 94b64ef

File tree

1 file changed

+22
-0
lines changed
  • Implementations/KnowledgeDB-Implementation/PainKiller.PowerCommands.KnowledgeDBCommands/Commands

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using PainKiller.PowerCommands.Configuration.DomainObjects;
2+
3+
namespace PainKiller.PowerCommands.KnowledgeDBCommands.Commands;
4+
5+
[PowerCommandTest( tests: " ")]
6+
[PowerCommandDesign( description: "Description of your command...",
7+
example: "demo")]
8+
public class CodeCommand : CommandBase<PowerCommandsConfiguration>
9+
{
10+
public CodeCommand(string identifier, PowerCommandsConfiguration configuration) : base(identifier, configuration) { }
11+
12+
public override RunResult Run()
13+
{
14+
try
15+
{
16+
var fileName = Path.Combine(ConfigurationGlobals.ApplicationDataFolder, $"{nameof(KnowledgeDatabase)}.data");
17+
ShellService.Service.Execute(Configuration.CodeEditor, arguments: fileName, ConfigurationGlobals.ApplicationDataFolder, WriteLine, fileExtension: "");
18+
}
19+
catch (Exception) { return BadParameterError("Your editor must be included in Path environment variables"); }
20+
return Ok();
21+
}
22+
}

0 commit comments

Comments
 (0)