feat(devkit): enforce governed prompt adoption
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
# CASAN_MANAGED_PROMPT_ENTRYPOINT
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(ValueFromRemainingArguments = $true)]
|
||||
[string[]] $Prompt,
|
||||
[string] $Distro = 'Ubuntu'
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$projectRootWindows = (Resolve-Path (Join-Path $PSScriptRoot '..')).Path
|
||||
$projectRootWsl = (& wsl.exe -d $Distro -- wslpath -a $projectRootWindows).Trim()
|
||||
if (-not $projectRootWsl) {
|
||||
throw 'CASAN could not resolve the project path in WSL2.'
|
||||
}
|
||||
|
||||
$arguments = @('-d', $Distro, '--cd', $projectRootWsl, './bin/casan-chat')
|
||||
if ($Prompt) {
|
||||
$arguments += $Prompt
|
||||
}
|
||||
|
||||
& wsl.exe @arguments
|
||||
exit $LASTEXITCODE
|
||||
Reference in New Issue
Block a user