-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.ps1
More file actions
46 lines (36 loc) · 1.24 KB
/
Copy pathsetup.ps1
File metadata and controls
46 lines (36 loc) · 1.24 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
# Root directory of dotfiles
$DotfilesDir = "$HOME\dotfiles"
# Mapping: source -> destination
$Links = @{
"$DotfilesDir\nvim" = "$HOME\AppData\Local\nvim"
"$DotfilesDir\yazi" = "$HOME\AppData\Roaming\yazi\config"
"$DotfilesDir\vim\.vimrc" = "$HOME\.vimrc"
"$DotfilesDir\wezterm" = "$HOME\.config\wezterm"
}
Write-Host "Creating symlinks..."
foreach ($src in $Links.Keys) {
$dst = $Links[$src]
if (Test-Path $dst) {
# Write-Host "Removing existing file/directory at $dst"
# Write-Host " "
Remove-Item -Path $dst -Recurse -Force
}
# Create parent directory if needed
$parent = Split-Path $dst
if (-not (Test-Path $parent)) {
New-Item -ItemType Directory -Path $parent | Out-Null
}
# Create symbolic link
New-Item -ItemType SymbolicLink -Path $dst -Target $src | Out-Null
Write-Host "Created symlink: $dst -> $src"
# Write-Host " "
}
Write-Host "All symlinks created."
# Check if yazi is installed
if (Get-Command "ya" -ErrorAction SilentlyContinue) {
Write-Host "yazi detected, upgrading packages..."
ya pkg upgrade
} else {
Write-Host "yazi not installed, skipping package upgrade."
}
Write-Host "=== All tasks completed successfully ==="