Add portable Zed Gist sync configuration
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
[CmdletBinding()]
|
||||
param()
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$source = Join-Path $env:APPDATA "Zed"
|
||||
$target = $PSScriptRoot
|
||||
$utf8 = New-Object System.Text.UTF8Encoding($false)
|
||||
|
||||
Copy-Item -LiteralPath (Join-Path $source "settings.json") -Destination (Join-Path $target "settings.json") -Force
|
||||
Copy-Item -LiteralPath (Join-Path $source "keymap.json") -Destination (Join-Path $target "keymap.json") -Force
|
||||
Copy-Item -LiteralPath (Join-Path $source "scripts\toggle-file-scan-exclusions.mjs") -Destination (Join-Path $target "scripts\toggle-file-scan-exclusions.mjs") -Force
|
||||
Copy-Item -LiteralPath (Join-Path $source "scripts\file-exclusions.json") -Destination (Join-Path $target "scripts\file-exclusions.json") -Force
|
||||
Copy-Item -LiteralPath (Join-Path $source "scripts\zed-settings-sync.mjs") -Destination (Join-Path $target "scripts\zed-settings-sync.mjs") -Force
|
||||
|
||||
$tasks = [IO.File]::ReadAllText((Join-Path $source "tasks.json"))
|
||||
foreach ($script in @(
|
||||
@{ Path = (Join-Path $source "scripts\toggle-file-scan-exclusions.mjs"); Placeholder = "__TOGGLE_SCRIPT__" },
|
||||
@{ Path = (Join-Path $source "scripts\zed-settings-sync.mjs"); Placeholder = "__SYNC_SCRIPT__" }
|
||||
)) {
|
||||
$tasks = $tasks.Replace($script.Path.Replace("\", "\\"), $script.Placeholder)
|
||||
$tasks = $tasks.Replace($script.Path.Replace("\", "/"), $script.Placeholder)
|
||||
}
|
||||
[IO.File]::WriteAllText((Join-Path $target "tasks.json"), $tasks, $utf8)
|
||||
|
||||
Write-Host "Exported Zed configuration from $source"
|
||||
Reference in New Issue
Block a user