Created
May 29, 2026 13:18
-
-
Save simensen/98e1c965b1dc87c8d73a65795d70d30d to your computer and use it in GitHub Desktop.
Fix Solo paths for Windows Beta
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $DbPath = Join-Path $env:USERPROFILE '.config\soloterm\solo.db' | |
| function Show-Projects($Label) { | |
| Write-Host "`n$Label" -ForegroundColor Cyan | |
| sqlite3 $DbPath 'SELECT id, path FROM projects' | |
| } | |
| function Invoke-Fix([string]$UpdateSql) { | |
| [int](sqlite3 -list $DbPath "$UpdateSql; SELECT changes();") | |
| } | |
| function Write-FixResult([int]$Count, [string]$Description) { | |
| $color = if ($Count -gt 0) { 'Green' } else { 'DarkGray' } | |
| $word = if ($Count -eq 1) { 'path' } else { 'paths' } | |
| Write-Host "$Count $Description project $word fixed" -ForegroundColor $color | |
| } | |
| Show-Projects 'Before:' | |
| # UNC fix must run first: \\?\UNC\... would otherwise match the bare \\?\ rule | |
| $uncFixed = Invoke-Fix @" | |
| UPDATE projects SET path = '\' || SUBSTR(path, 8) | |
| WHERE SUBSTR(path, 1, 8) = '\\?\UNC\' | |
| "@ | |
| $winFixed = Invoke-Fix @" | |
| UPDATE projects SET path = SUBSTR(path, 5) | |
| WHERE SUBSTR(path, 1, 4) = '\\?\' | |
| "@ | |
| Show-Projects 'After:' | |
| Write-Host '' | |
| Write-FixResult $winFixed 'Windows-style' | |
| Write-FixResult $uncFixed 'WSL-style' |
Author
Author
λ ~ › .\fix-solo.ps1
Before:
╭────┬────────────────────────────────────────────────────────────────────────────────────────────────╮
│ id │ path │
╞════╪════════════════════════════════════════════════════════════════════════════════════════════════╡
│ 10 │ \\?\UNC\wsl.localhost\ABC-Ubuntu-24.04\home\bsimensen\Code\bizapps-symfony-bot │
│ 9 │ \\?\UNC\wsl.localhost\ABC-Ubuntu-24.04\home\bsimensen\Code\gitlab-unified-linkifyer-userscript │
│ 11 │ \\?\UNC\wsl.localhost\ABC-Ubuntu-24.04\home\bsimensen\Code\images │
│ 12 │ \\?\UNC\wsl.localhost\ABC-Ubuntu-24.04\home\bsimensen\Code\litellm │
│ 6 │ \\wsl.localhost\ABC-Ubuntu-24.04\home\bsimensen\Workspaces\dev\abcapps │
│ 8 │ \\wsl.localhost\ABC-Ubuntu-24.04\home\bsimensen\Workspaces\performance\abcapps │
╰────┴────────────────────────────────────────────────────────────────────────────────────────────────╯
After:
╭────┬──────────────────────────────────────────────────────────────────────────────────────────╮
│ id │ path │
╞════╪══════════════════════════════════════════════════════════════════════════════════════════╡
│ 10 │ \\wsl.localhost\ABC-Ubuntu-24.04\home\bsimensen\Code\bizapps-symfony-bot │
│ 9 │ \\wsl.localhost\ABC-Ubuntu-24.04\home\bsimensen\Code\gitlab-unified-linkifyer-userscript │
│ 11 │ \\wsl.localhost\ABC-Ubuntu-24.04\home\bsimensen\Code\images │
│ 12 │ \\wsl.localhost\ABC-Ubuntu-24.04\home\bsimensen\Code\litellm │
│ 6 │ \\wsl.localhost\ABC-Ubuntu-24.04\home\bsimensen\Workspaces\dev\abcapps │
│ 8 │ \\wsl.localhost\ABC-Ubuntu-24.04\home\bsimensen\Workspaces\performance\abcapps │
╰────┴──────────────────────────────────────────────────────────────────────────────────────────╯
0 Windows-style project paths fixed
4 WSL-style project paths fixed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Successful run will output the following:
Safe to run multiple times as new projects are added or if paths get reverted somehow: