-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.ps1
More file actions
59 lines (46 loc) · 2.27 KB
/
bootstrap.ps1
File metadata and controls
59 lines (46 loc) · 2.27 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
function New-Symlink {
param (
[string]$Path,
[string]$Target,
[string]$ItemType
)
if (Test-Path $Path) {
Write-Host "Removing existing $Path"
Remove-Item -Path $Path -Recurse -Force
}
$ResolvedTarget = (Get-Item $Target | Resolve-Path).ProviderPath
Write-Host "Linking $Path -> $ResolvedTarget as $ItemType"
New-Item -Path $Path -ItemType $ItemType -Value $ResolvedTarget
}
# Verify Nuget version is installed
$version = "2.8.5.208"
Write-Host "Verifying NuGet $version or later is installed"
$nuget = Get-PackageProvider -Name NuGet -ListAvailable -ErrorAction SilentlyContinue |
Sort-Object -Property {[version]$_.version} | Select-Object -Last 1
if(-not $nuget -or [version]$nuget.version -lt [version]$version){
Write-Host "Installing NuGet $($nuget.Version)"
$null = Install-PackageProvider -Name NuGet -MinimumVersion $nuget.version -Force
}
# Install Required Modules
Install-Module PSReadLine -Repository PSGallery -Scope CurrentUser -Force -Confirm:$false
Install-Module Terminal-Icons -Repository PSGallery -Scope CurrentUser -Force -Confirm:$false
# Komorebi
New-Symlink -Path "${env:USERPROFILE}/.config/komorebi" -Target ".\.config\komorebi\" -ItemType "Junction"
# Git Config
Copy-Item -Path ".\.config\.gitconfig" -Destination "${env:USERPROFILE}\.gitconfig"
# Powershell Profile
New-Symlink -Path "$PROFILE" -Target "./PowerShell/Microsoft.PowerShell_profile.ps1" -ItemType "HardLink"
# WSL Config
New-Symlink -Path "${env:USERPROFILE}/.wslconfig" -Target ".\.config\.wslconfig" -ItemType "HardLink"
# Wakatime config
Copy-Item -Path ".\.config\.wakatime.cfg" -Destination "${env:USERPROFILE}\.wakatime.cfg"
# Starship
New-Symlink -Path "${env:USERPROFILE}/.config/starship.toml" -Target ".\.config\starship.toml" -ItemType "HardLink"
# wezterm
New-Symlink -Path "${env:USERPROFILE}/.config/wezterm" -Target ".\.config\wezterm\" -ItemType "Junction"
# alacrity
New-Symlink -Path "${env:APPDATA}/alacritty" -Target ".\.config\alacritty\" -ItemType "Junction"
# lazygit
New-Symlink -Path "${env:USERPROFILE}/AppData/Local/lazygit/config.yml" -Target ".\.config\lazygit\config.yml" -ItemType "HardLink"
# nvim
New-Symlink -Path "${env:LOCALAPPDATA}/nvim" -Target ".\.config\nvim\" -ItemType "Junction"