-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.ps1
More file actions
76 lines (65 loc) · 2.86 KB
/
Copy pathinstall.ps1
File metadata and controls
76 lines (65 loc) · 2.86 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
66
67
68
69
70
71
72
73
74
75
76
#Requires -RunAsAdministrator
# Windows install script — pairs with install.sh for Linux/macOS
# Run from repo root: .\install.ps1
$ErrorActionPreference = "Stop"
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
function Install-WingetPackage {
param([string]$Id, [string]$Name)
$installed = winget list --id $Id 2>$null | Select-String $Id
if ($installed) {
Write-Host " $Name already installed, skipping"
} else {
Write-Host " Installing $Name..."
winget install --id $Id --silent --accept-package-agreements --accept-source-agreements
}
}
function New-Symlink {
param([string]$Target, [string]$Link)
$parent = Split-Path -Parent $Link
if (!(Test-Path $parent)) { New-Item -ItemType Directory -Path $parent -Force | Out-Null }
if (Test-Path $Link) { Remove-Item $Link -Force -Recurse }
New-Item -ItemType SymbolicLink -Path $Link -Target $Target | Out-Null
}
Write-Host "Installing packages..."
Install-WingetPackage "Starship.Starship" "starship"
Install-WingetPackage "CoreyButler.NVMforWindows" "nvm for windows"
Install-WingetPackage "Git.Git" "git"
Write-Host "Installing Node.js LTS..."
$nvmCmd = "$env:APPDATA\nvm\nvm.exe"
if (Test-Path $nvmCmd) {
& $nvmCmd install lts
& $nvmCmd use lts
} else {
Write-Warning "nvm not found at expected path — open a new shell and run: nvm install lts && nvm use lts"
}
Write-Host "Installing Claude Code..."
$claudeInstalled = npm list -g @anthropic-ai/claude-code 2>$null | Select-String "claude-code"
if (!$claudeInstalled) {
npm install -g @anthropic-ai/claude-code
} else {
Write-Host " already installed, skipping"
}
Write-Host "Symlinking dotfiles..."
# Starship config — starship checks both %APPDATA% and ~/.config on Windows
$starshipTarget = "$ScriptDir\dotfiles\.config\starship.toml"
New-Symlink -Target $starshipTarget -Link "$env:USERPROFILE\.config\starship.toml"
Write-Host " starship.toml -> ~/.config/starship.toml"
# Git config
New-Symlink -Target "$ScriptDir\dotfiles\.gitconfig" -Link "$env:USERPROFILE\.gitconfig"
Write-Host " .gitconfig -> ~/.gitconfig"
Write-Host "Setting up PowerShell profile..."
$profileDir = Split-Path -Parent $PROFILE
if (!(Test-Path $profileDir)) { New-Item -ItemType Directory -Path $profileDir -Force | Out-Null }
$starshipLine = 'Invoke-Expression (&starship init powershell)'
if (!(Test-Path $PROFILE) -or !(Select-String -Path $PROFILE -Pattern "starship init" -Quiet)) {
Add-Content -Path $PROFILE -Value "`n$starshipLine"
Write-Host " added starship init to $PROFILE"
} else {
Write-Host " starship already in profile, skipping"
}
Write-Host ""
Write-Host "Done!"
Write-Host ""
Write-Host "FIRST RUN CHECKLIST:"
Write-Host " 1. Install FiraCode Nerd Font manually from nerdfonts.com and set it in your terminal"
Write-Host " 2. Run: nvm install lts && nvm use lts (if nvm wasn't on PATH yet)"