From 6963a31d8878a4b644412745f6962260362141f6 Mon Sep 17 00:00:00 2001 From: srdusr Date: Sun, 16 Jul 2023 06:17:47 +0200 Subject: Fixed join-path --- win-nvim.ps1 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/win-nvim.ps1 b/win-nvim.ps1 index 2ca2509..1e208d7 100644 --- a/win-nvim.ps1 +++ b/win-nvim.ps1 @@ -1,3 +1,8 @@ +# Install Git (if not already present on the system) +if (!(Get-Command git -ErrorAction SilentlyContinue)) { + winget install Git.Git +} + # Install NeoVim with winget, if not already present on the system if (!(Get-Command nvim -ErrorAction SilentlyContinue)) { winget install Neovim.Neovim @@ -12,10 +17,10 @@ if (!(Test-Path $dotFilesRoot -PathType Container)) { # Link NeoVim configuration $localConfiguration = Join-Path $env:LOCALAPPDATA "nvim" -$dotfilesConfiguration = Join-Path $dotFilesRoot ".config" "nvim" +$dotfilesConfiguration = Join-Path (Join-Path $dotFilesRoot ".config") "nvim" if (!(Test-Path $localConfiguration -PathType Container)) { - Start-Process -FilePath "cmd.exe" -ArgumentList "/c mklink /D $localConfiguration $dotfilesConfiguration" -Verb runas + Start-Process -FilePath "cmd.exe" -ArgumentList "/c mklink /D `"$localConfiguration`" `"$dotfilesConfiguration`"" -Verb runas } # Clone Packer.nvim, if not already present on the system @@ -25,6 +30,11 @@ if (!(Test-Path $localPacker -PathType Container)) { git clone https://github.com/wbthomason/packer.nvim $localPacker } +# To allow script execution, run the following command in PowerShell as an administrator: +# Set-ExecutionPolicy RemoteSigned +# Then run the script by using this command in the same existing directory: +# ./win-nvim.ps1 + # To allow script execution, run the following command in PowerShell as an administrator: # Set-ExecutionPolicy RemoteSigned # Then run the script by using this command in the same existing directory: @@ -50,4 +60,3 @@ if (!(Test-Path $localPacker -PathType Container)) { #Unexpected token 'Refresh' in expression or statement. # + CategoryInfo : ParserError: (:) [], ParseException # + FullyQualifiedErrorId : MissingExpressionAfterOperator - -- cgit v1.2.3