Redesign Zed Gist sync workflow
This commit is contained in:
+11
@@ -25,6 +25,17 @@ Copy-Item -LiteralPath (Join-Path $source "scripts\zed-settings-sync.mjs") -Dest
|
||||
$syncConfig = Join-Path $target "scripts\settings-sync.json"
|
||||
if (-not (Test-Path -LiteralPath $syncConfig)) {
|
||||
Copy-Item -LiteralPath (Join-Path $source "scripts\settings-sync.json") -Destination $syncConfig
|
||||
} else {
|
||||
$existingState = Get-Content -LiteralPath $syncConfig -Raw | ConvertFrom-Json
|
||||
$migratedState = [ordered]@{
|
||||
gist_id = if ($existingState.gist_id -is [string]) { $existingState.gist_id } else { "" }
|
||||
last_synced_hash = if ($existingState.last_synced_hash -is [string]) { $existingState.last_synced_hash } else { "" }
|
||||
auto_sync = $existingState.auto_sync -eq $true
|
||||
interval_minutes = if ($existingState.interval_minutes -is [int] -and $existingState.interval_minutes -ge 5) { $existingState.interval_minutes } else { 15 }
|
||||
last_run_at = if ($existingState.last_run_at -is [string]) { $existingState.last_run_at } else { "" }
|
||||
last_result = if ($existingState.last_result -is [string]) { $existingState.last_result } else { "" }
|
||||
} | ConvertTo-Json
|
||||
[IO.File]::WriteAllText($syncConfig, "$migratedState`n", $utf8)
|
||||
}
|
||||
|
||||
$toggleScriptPath = (Join-Path $target "scripts\toggle-file-scan-exclusions.mjs").Replace("\", "/")
|
||||
|
||||
Reference in New Issue
Block a user