forked from mxx1111/mdlook
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlink-claude-skills.ps1
More file actions
25 lines (21 loc) · 817 Bytes
/
Copy pathlink-claude-skills.ps1
File metadata and controls
25 lines (21 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Links .claude/skills -> .agents/skills for Claude Code discovery.
# Uses directory junction on Windows (no admin required).
$ErrorActionPreference = 'Stop'
$root = Split-Path -Parent $PSScriptRoot
$link = Join-Path $root '.claude\skills'
$target = Join-Path $root '.agents\skills'
if (-not (Test-Path $target)) {
Write-Error "Missing target directory: $target"
}
if (Test-Path $link) {
$item = Get-Item $link -Force
if ($item.LinkType -eq 'Junction' -or $item.LinkType -eq 'SymbolicLink') {
if ($item.Target -contains $target -or $item.Target -contains (Resolve-Path $target).Path) {
Write-Host "Already linked: $link -> $target"
exit 0
}
}
Remove-Item $link -Force -Recurse
}
New-Item -ItemType Junction -Path $link -Target $target | Out-Null
Write-Host "Linked $link -> $target"