-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📝 Chore(i18n): Available to execute XamlMLE through cheese
- Loading branch information
1 parent
75ebf40
commit 601f75b
Showing
2 changed files
with
124 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System.Diagnostics; | ||
using Common.BasicHelper.Core.Shell; | ||
using Common.BasicHelper.Utils.Extensions; | ||
using Spectre.Console; | ||
|
||
var utilsToLaunch = AnsiConsole.Prompt( | ||
new MultiSelectionPrompt<string>() | ||
.Title("Which [green]i18n utils[/] are to be launched ?") | ||
.NotRequired() | ||
.PageSize(10) | ||
.MoreChoicesText("[grey](Move up and down to reveal more utils)[/]") | ||
.InstructionsText("[grey](Press [blue]<space>[/] to toggle a i18n util, [green]<enter>[/] to accept)[/]") | ||
.AddChoices( | ||
new[] { | ||
"KitX Dashboard (XamlMLE)" | ||
} | ||
) | ||
); | ||
|
||
var baseDir = PathHelper.Instance.BaseSlnDir; | ||
|
||
foreach (var util in utilsToLaunch) | ||
{ | ||
AnsiConsole.MarkupLine($"@ Launching {util}"); | ||
|
||
switch (util) | ||
{ | ||
case "KitX Dashboard (XamlMLE)": | ||
var xamlMleDir = $"{baseDir}/KitX SDK/Reference/XamlMultiLanguageEditor".GetFullPath(); | ||
var scriptPath = $"{xamlMleDir}/run.ps1".GetFullPath(); | ||
|
||
var args = new StringBuilder() | ||
.Append($" -WorkingDirectory \"{xamlMleDir}\"") | ||
.Append($" -Command \"& '{scriptPath}'\"") | ||
.ToString() | ||
; | ||
|
||
Console.WriteLine(args); | ||
|
||
var result = "pwsh".ExecuteAsCommand(args: args, findInPath: true); | ||
|
||
Console.WriteLine(result); | ||
|
||
break; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters