Skip to content

Commit

Permalink
Fix Start-AIShell to correctly get the executable path from PATH en…
Browse files Browse the repository at this point in the history
…v variable (#272)
  • Loading branch information
daxian-dbw authored Nov 1, 2024
1 parent 0e2def5 commit 896077a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions shell/AIShell.Integration/Commands/StartAishCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ protected override void BeginProcessing()
{
if (Path is null)
{
Path = "aish";
if (SessionState.InvokeCommand.GetCommand(Path, CommandTypes.Application) is null)
var app = SessionState.InvokeCommand.GetCommand("aish", CommandTypes.Application);
if (app is null)
{
ThrowTerminatingError(new(
new NotSupportedException("The executable 'aish' cannot be found."),
"AIShellMissing",
ErrorCategory.NotInstalled,
targetObject: null));
}

Path = app.Source;
}
else
{
Expand Down

0 comments on commit 896077a

Please sign in to comment.