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 <oz-agent@warp.dev>
This commit is contained in:
@@ -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 `<target>.bak-<timestamp>`
|
||||
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
|
||||
|
||||
+14
-3
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user