Scripts work under pwsh on Linux and macOS

Home, VS Code user folder and CLI are resolved per platform (with
VSCODE_USER_DIR as an override); dev-link makes a symlink where a
junction is not available.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169iPWwKHZoBTNN9qwXiwqk
This commit is contained in:
max
2026-09-08 19:30:43 +02:00
co-authored by Claude Fable 5.1
parent 196513e30c
commit 9085266dd3
4 changed files with 62 additions and 14 deletions
+4 -2
View File
@@ -38,7 +38,7 @@ $ErrorActionPreference = 'Stop'
. (Join-Path $PSScriptRoot 'common.ps1')
$config = Get-SetupConfig
$extensionsDir = Join-Path $env:USERPROFILE '.vscode\extensions'
$extensionsDir = Join-Path (Get-HomeDir) '.vscode/extensions'
if (-not (Test-Path $extensionsDir)) {
New-Item -ItemType Directory -Path $extensionsDir -Force | Out-Null
}
@@ -103,7 +103,9 @@ foreach ($extension in $extensions) {
"(it may be a real installed copy).")
}
New-Item -ItemType Junction -Path $link -Target $source | Out-Null
# A junction needs no privilege on Windows; elsewhere a plain symlink does the same job.
$linkType = if (Test-IsWindows) { 'Junction' } else { 'SymbolicLink' }
New-Item -ItemType $linkType -Path $link -Target $source | Out-Null
Write-Host "linked $linkName -> $source" -ForegroundColor Green
}