-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
63 lines (51 loc) · 1.91 KB
/
Copy pathinstall.ps1
File metadata and controls
63 lines (51 loc) · 1.91 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
$ErrorActionPreference = "Stop"
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$SkillSrc = Join-Path $ScriptDir "plugin/the-typescript-narrows/skills/typescript-narrows"
$Runtime = if ($args.Count -gt 0) { $args[0] } else { "both" }
if ($Runtime -notmatch "^(claude|copilot|both)$") {
Write-Host "Usage: .\install.ps1 [claude|copilot|both]"
Write-Host ""
Write-Host " claude Install to `$env:USERPROFILE\.claude\skills only"
Write-Host " copilot Install to `$env:USERPROFILE\.copilot\skills only"
Write-Host " both Install to both locations (default)"
exit 1
}
if (-not (Test-Path $SkillSrc -PathType Container)) {
Write-Error "Error: skill directory not found at $SkillSrc"
exit 1
}
function Install-ToDestination {
param(
[string]$DestinationName,
[string]$SkillsDst
)
if (-not (Test-Path $SkillsDst)) {
New-Item -ItemType Directory -Path $SkillsDst -Force | Out-Null
}
$target = Join-Path $SkillsDst "typescript-narrows"
if (Test-Path $target) {
Remove-Item -Recurse -Force $target
}
Copy-Item -Recurse $SkillSrc $target
Write-Host "Installed typescript-narrows to $DestinationName"
Write-Host "Done. Skill installed to $target"
}
Write-Host "Installing TypeScript Narrows skill to runtime: $Runtime"
Write-Host ""
switch ($Runtime) {
"claude" {
$ClaudeSkills = Join-Path $env:USERPROFILE ".claude\skills"
Install-ToDestination "Claude" $ClaudeSkills
}
"copilot" {
$CopilotSkills = Join-Path $env:USERPROFILE ".copilot\skills"
Install-ToDestination "Copilot" $CopilotSkills
}
"both" {
$ClaudeSkills = Join-Path $env:USERPROFILE ".claude\skills"
$CopilotSkills = Join-Path $env:USERPROFILE ".copilot\skills"
Install-ToDestination "Claude" $ClaudeSkills
Write-Host ""
Install-ToDestination "Copilot" $CopilotSkills
}
}