From e5ceee5caae580515a8c779000afdcad2f27f516 Mon Sep 17 00:00:00 2001 From: tevans Date: Thu, 18 Jun 2026 21:03:25 +0100 Subject: [PATCH] Add -DataRoot/-ConfigRoot params to installer Allow overriding Warp config target roots (defaults preserved) for testing and non-standard installs; document in README. Co-Authored-By: Oz --- README.md | 10 ++++++++++ install.ps1 | 17 ++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4529b3d..26f975b 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,16 @@ pwsh -File .\install.ps1 -Force # delete existing real targets instead of bac Existing real files at a target are backed up to `.bak-` unless `-Force` is used. +The target roots can also be overridden (handy for testing or non-standard +installs); they default to the standard Warp locations: + +```powershell +pwsh -File .\install.ps1 -DataRoot C:\tmp\data -ConfigRoot C:\tmp\config -DryRun +``` + +- `-DataRoot` — defaults to `%APPDATA%\warp\Warp\data` (tab_configs, themes, keybindings.yaml) +- `-ConfigRoot` — defaults to `%LOCALAPPDATA%\warp\Warp\config` (settings.toml) + ## Updating Because the targets are symlinks back into this repo, edits made in Warp land diff --git a/install.ps1 b/install.ps1 index 398f1e1..c161568 100644 --- a/install.ps1 +++ b/install.ps1 @@ -15,6 +15,15 @@ * Developer Mode enabled (Settings > Privacy & security > For developers), or * Running this script from an elevated (Administrator) PowerShell. +.PARAMETER DataRoot + Override the Warp "data" root (where tab_configs, themes, and + keybindings.yaml live). Defaults to %APPDATA%\warp\Warp\data. + Useful for testing or non-standard installs. + +.PARAMETER ConfigRoot + Override the Warp "config" root (where settings.toml lives). + Defaults to %LOCALAPPDATA%\warp\Warp\config. + .PARAMETER DryRun Print what would happen without making changes. @@ -24,9 +33,12 @@ .EXAMPLE pwsh -ExecutionPolicy Bypass -File .\install.ps1 pwsh -File .\install.ps1 -DryRun + pwsh -File .\install.ps1 -DataRoot C:\tmp\data -ConfigRoot C:\tmp\config -DryRun #> [CmdletBinding()] param( + [string]$DataRoot = (Join-Path $env:APPDATA 'warp\Warp\data'), + [string]$ConfigRoot = (Join-Path $env:LOCALAPPDATA 'warp\Warp\config'), [switch]$DryRun, [switch]$Force ) @@ -34,9 +46,8 @@ param( $ErrorActionPreference = 'Stop' $RepoRoot = $PSScriptRoot -# Resolve Warp config roots. APPDATA = Roaming (data), LOCALAPPDATA = Local (config). -$DataRoot = Join-Path $env:APPDATA 'warp\Warp\data' -$ConfigRoot = Join-Path $env:LOCALAPPDATA 'warp\Warp\config' +# Warp config roots. APPDATA = Roaming (data), LOCALAPPDATA = Local (config). +# Both are overridable via the -DataRoot / -ConfigRoot parameters above. # Managed entries: Source is relative to the repo, Target is absolute. # Type is 'File' or 'Directory' (controls how the symlink is created).