sojorn/sojorn_app/run_dev.ps1
Patrick Britton bc35eea69b feat: add NSFW self-labeling toggle in compose, blur setting in user preferences, improve signup date pickers with modal sheets
- Add `isNsfw` checkbox to compose screen for user self-labeling
- Add `nsfwBlurEnabled` setting to UserSettings model (default true)
- Replace signup month/year dropdowns with modal bottom sheet pickers
- Preload Noto Color Emoji font on app startup
- Refactor notifications/discover screens to use FullScreenShell component
2026-02-07 18:15:54 -06:00

53 lines
1.3 KiB
PowerShell

param(
[string]$EnvPath = (Join-Path $PSScriptRoot "..\.env")
)
if (-not (Test-Path $EnvPath)) {
Write-Error "Env file not found: ${EnvPath}"
exit 1
}
$values = @{}
Get-Content $EnvPath | ForEach-Object {
$line = $_.Trim()
if ($line.Length -eq 0) { return }
if ($line.StartsWith('#')) { return }
$parts = $line -split '=', 2
if ($parts.Count -lt 2) { return }
$key = $parts[0].Trim()
$value = $parts[1].Trim()
if ($value.StartsWith('"') -and $value.EndsWith('"')) {
$value = $value.Substring(1, $value.Length - 2)
}
$values[$key] = $value
}
$required = @('API_BASE_URL')
$missing = $required | Where-Object {
-not $values.ContainsKey($_) -or [string]::IsNullOrWhiteSpace($values[$_])
}
if ($missing.Count -gt 0) {
Write-Error "Missing required keys in ${EnvPath}: $($missing -join ', ')"
exit 1
}
$defineArgs = @(
"--dart-define=API_BASE_URL=$($values['API_BASE_URL'])"
)
if ($values.ContainsKey('TURNSTILE_SITE_KEY') -and -not [string]::IsNullOrWhiteSpace($values['TURNSTILE_SITE_KEY'])) {
$defineArgs += "--dart-define=TURNSTILE_SITE_KEY=$($values['TURNSTILE_SITE_KEY'])"
}
Write-Host "Starting Sojorn in development mode..." -ForegroundColor Green
Write-Host "Tip: press 'r' to hot reload, 'R' to hot restart, 'q' to quit" -ForegroundColor DarkGray
Write-Host ""
Set-Location $PSScriptRoot
& flutter run @defineArgs @Args