feat: publish downloadable wakeword trainer source
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
$release = "0.2.1-jrich-2"
|
||||
$source = (& wsl.exe wslpath -a -u -- $PSScriptRoot).Trim()
|
||||
|
||||
if ($LASTEXITCODE -ne 0 -or -not $source) {
|
||||
throw "WSL2 is required. Install WSL2 with Ubuntu, then run this file again."
|
||||
}
|
||||
|
||||
$target = (& wsl.exe bash -lc "printf '%s' \"`$HOME/.local/share/jrich-wakeword-trainer/$release\"").Trim()
|
||||
if ($LASTEXITCODE -ne 0 -or -not $target) {
|
||||
throw "Could not resolve the trainer directory inside WSL2."
|
||||
}
|
||||
|
||||
& wsl.exe --exec env "JR_TRAINER_SOURCE=$source" "JR_TRAINER_TARGET=$target" bash -lc '
|
||||
set -euo pipefail
|
||||
mkdir -p "$JR_TRAINER_TARGET"
|
||||
cp -a "$JR_TRAINER_SOURCE/." "$JR_TRAINER_TARGET/"
|
||||
chmod +x "$JR_TRAINER_TARGET/start.sh" "$JR_TRAINER_TARGET/scripts/jrich-wakeword-trainer"
|
||||
'
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Could not install the trainer into the WSL2 filesystem."
|
||||
}
|
||||
|
||||
& wsl.exe --cd $target ./start.sh @args
|
||||
exit $LASTEXITCODE
|
||||
Reference in New Issue
Block a user