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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user