From ef14594a9fdac3c1a77be5f4e498afea03ef4f4d Mon Sep 17 00:00:00 2001 From: vitya Date: Wed, 6 May 2026 11:48:04 +0300 Subject: [PATCH] =?UTF-8?q?Add=20scripts/install.ps1=20=E2=80=94=20PowerSh?= =?UTF-8?q?ell=20port=20of=20install.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Native cmdlet equivalent of install.sh: same behavior (copy each skills// into ~\.claude\skills\\, skip if SKILL.md is missing, support $env:CLAUDE_SKILLS_DIR override and -Names filter). Removes bash dependency on Windows — no need to invoke git-bash from pwsh, mirrors the existing build.sh / build.ps1 pair. Co-Authored-By: Claude Opus 4.7 (1M context) --- scripts/install.ps1 | 46 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 scripts/install.ps1 diff --git a/scripts/install.ps1 b/scripts/install.ps1 new file mode 100644 index 0000000..18eb065 --- /dev/null +++ b/scripts/install.ps1 @@ -0,0 +1,46 @@ +# Install skills// into ~\.claude\skills\\ (or $env:CLAUDE_SKILLS_DIR) +# Usage: install.ps1 [-Names ,] (no args = all) +# +# PowerShell port of install.sh — same behavior, native cmdlets, no bash dependency. + +[CmdletBinding()] +param( + [string[]]$Names = @() +) + +$ErrorActionPreference = 'Stop' + +$root = Split-Path -Parent $PSScriptRoot +$src = Join-Path $root 'skills' + +if ($env:CLAUDE_SKILLS_DIR) { + $target = $env:CLAUDE_SKILLS_DIR +} else { + $target = Join-Path $env:USERPROFILE '.claude\skills' +} + +if (-not (Test-Path $target)) { + New-Item -ItemType Directory -Force -Path $target | Out-Null +} + +if ($Names.Count -eq 0) { + $Names = Get-ChildItem -Path $src -Directory | Sort-Object Name | Select-Object -ExpandProperty Name +} + +foreach ($name in $Names) { + $srcDir = Join-Path $src $name + $dstDir = Join-Path $target $name + if (-not (Test-Path $srcDir -PathType Container)) { + Write-Warning "skip: $name (not found in skills/)" + continue + } + if (-not (Test-Path (Join-Path $srcDir 'SKILL.md'))) { + Write-Warning "skip: $name (missing SKILL.md)" + continue + } + if (Test-Path $dstDir) { + Remove-Item -Recurse -Force $dstDir + } + Copy-Item -Recurse $srcDir $dstDir + Write-Host "installed: $name -> $dstDir" +}