-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.ps1
27 lines (25 loc) · 959 Bytes
/
setup.ps1
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
# check if run as Administrator
$Current = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$CurrenPrincipal = New-Object System.Security.Principal.WindowsPrincipal($Current)
if ( -Not $CurrenPrincipal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator))
{
Write-Host "Please run as Administrator"
exit
}
$NvimConfigPath = "$ENV:USERPROFILE\AppData\Local\nvim"
$WorkPath = "$(Get-Location)"
# remove old nvim config
if (Test-Path $NvimConfigPath)
{
Remove-Item -Recurse -Force $NvimConfigPath
}
# create symbolic link
New-Item -ItemType SymbolicLink -Verbose -Path $NvimConfigPath -Target "$WorkPath\nvchad"
if (-Not (Test-Path $NvimConfigPath\ftplugin))
{
New-Item -ItemType SymbolicLink -Verbose -Path $NvimConfigPath\ftplugin -Target "$WorkPath\ftplugin"
}
if (-Not (Test-Path $NvimConfigPath\lua\custom))
{
New-Item -ItemType SymbolicLink -Verbose -Path $NvimConfigPath\lua\custom -Target "$WorkPath\lua\custom"
}