Repository navigation
Expand file tree
/
Copy pathinstall.ps1
More file actions
65 lines (53 loc) · 2.18 KB
/
Copy pathinstall.ps1
File metadata and controls
65 lines (53 loc) · 2.18 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
64
65
#Requires -Version 5.1
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$SkillName = "jetredline"
$InstallDir = Join-Path $HOME ".claude\skills\$SkillName"
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
Write-Host "Installing $SkillName skill..."
# Create target directory
New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null
# Copy skill files
$SourceDir = Join-Path $ScriptDir "skills\jetredline"
Copy-Item -Path "$SourceDir\*" -Destination $InstallDir -Recurse -Force
Write-Host "Installed to $InstallDir"
# --- Python virtual environment ---
Write-Host ""
Write-Host "Setting up Python virtual environment..."
$VenvDir = Join-Path $InstallDir ".venv"
$VenvPython = Join-Path $VenvDir "Scripts\python.exe"
if (Get-Command uv -ErrorAction SilentlyContinue) {
Write-Host "Using uv to create venv..."
& uv venv $VenvDir --clear
& uv pip install -r "$InstallDir\requirements.txt" --python $VenvPython
} elseif (Get-Command python3 -ErrorAction SilentlyContinue) {
Write-Host "Using python3 to create venv..."
& python3 -m venv $VenvDir --clear
& $VenvPython -m pip install --upgrade pip
& $VenvPython -m pip install -r "$InstallDir\requirements.txt"
} elseif (Get-Command python -ErrorAction SilentlyContinue) {
Write-Host "Using python to create venv..."
& python -m venv $VenvDir --clear
& $VenvPython -m pip install --upgrade pip
& $VenvPython -m pip install -r "$InstallDir\requirements.txt"
} else {
Write-Host "ERROR: Neither uv nor python found. Cannot create virtual environment." -ForegroundColor Red
Write-Host " Install Python 3 from https://www.python.org/ or uv from https://docs.astral.sh/uv/"
exit 1
}
Write-Host "Python packages installed."
# --- Node.js dependencies ---
Write-Host ""
Write-Host "Installing Node.js dependencies..."
if (Get-Command npm -ErrorAction SilentlyContinue) {
Push-Location $InstallDir
& npm install
Pop-Location
Write-Host "Node packages installed."
} else {
Write-Host "ERROR: npm not found. Cannot install Node.js dependencies." -ForegroundColor Red
Write-Host " Install Node.js from https://nodejs.org/"
exit 1
}
Write-Host ""
Write-Host "Done."