17 lines
415 B
PowerShell
17 lines
415 B
PowerShell
$ErrorActionPreference = 'Stop'
|
|
Set-Location $PSScriptRoot
|
|
|
|
if (-not (Test-Path 'config.ini')) {
|
|
Copy-Item 'config.example.ini' 'config.ini'
|
|
Write-Host '已生成 config.ini,请填写 [github] Token 后重新运行。'
|
|
exit 1
|
|
}
|
|
|
|
python -c "import flask, requests" 2>$null
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Host '安装依赖...'
|
|
python -m pip install -r requirements.txt
|
|
}
|
|
|
|
python app.py serve
|