aziz9788's picture
Initial commit
cf8c8d4
Raw History Blame Contribute Delete
1.01 kB
# Dot-sourced by architectures\*\*.ps1. Moves to the repo root and sets the folder variables
# (same defaults and environment variables as common/paths.py).
$ErrorActionPreference = "Stop"
Set-Location (Join-Path $PSScriptRoot "..")
$W = if ($env:OCR_WORK_DIR) { $env:OCR_WORK_DIR } else { "data" }
$MODELS = if ($env:OCR_MODELS_DIR) { $env:OCR_MODELS_DIR } else { "$W/models" }
$UPSTREAM = if ($env:OCR_UPSTREAM_DIR) { $env:OCR_UPSTREAM_DIR } else { "$W/upstream" }
$PREPARED = if ($env:OCR_PREPARED_DIR) { $env:OCR_PREPARED_DIR } else { "$W/prepared" }
$RUNS = if ($env:OCR_RUNS_DIR) { $env:OCR_RUNS_DIR } else { "$W/runs" }
$PY = if ($env:PYTHON) { $env:PYTHON } else { "python" }
# Run a native command and stop the script if it fails (Windows PowerShell does not do this by itself).
function Invoke-Step {
$exe, $rest = $args
& $exe @rest
if ($LASTEXITCODE -ne 0) { throw "failed (exit $LASTEXITCODE): $exe $rest" }
}