-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
29 lines (24 loc) · 1.05 KB
/
install.ps1
File metadata and controls
29 lines (24 loc) · 1.05 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
# Definir la ruta de configuración
$configDir = "$env:LOCALAPPDATA\DeltaNvim"
# Crear el directorio de configuración
if (-not (Test-Path $configDir)) {
New-Item -ItemType Directory -Path $configDir | Out-Null
}
# Copiar archivos necesarios
Copy-Item -Path ".\init.lua" -Destination $configDir
Copy-Item -Path ".\lua" -Destination $configDir -Recurse
Copy-Item -Path ".\bin" -Destination $configDir -Recurse
# Hacer que el script dnvim.bat sea ejecutable (no es necesario en Windows, pero lo marcamos como ejecutable)
$dnvimPath = "$configDir\bin\dnvim.bat"
if (Test-Path $dnvimPath) {
Set-ItemProperty -Path $dnvimPath -Name IsReadOnly -Value $false
}
# Agregar al PATH del usuario
$binPath = "$configDir\bin"
$userPath = [Environment]::GetEnvironmentVariable('Path', 'User')
if ($userPath -notmatch [Regex]::Escape($binPath)) {
[Environment]::SetEnvironmentVariable('Path', "$userPath;$binPath", 'User')
Write-Host "DeltaNvim has been added to your PATH. Please restart your terminal."
} else {
Write-Host "DeltaNvim is already in your PATH."
}