From a1699e940ce00d11ffc66a799138c7d883c736da Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Tue, 27 Aug 2024 12:35:30 +0200 Subject: [PATCH] copying easy configuration files --- install_windows.ps1 | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/install_windows.ps1 b/install_windows.ps1 index a91a0b0..2f76342 100644 --- a/install_windows.ps1 +++ b/install_windows.ps1 @@ -41,4 +41,34 @@ if (IsInDotfilesRepo -currentDir $currentDir) git -C $dotfilesRepo pull } } + +# Function to copy files with overwrite prompt +function CopyFileWithPrompt +{ + param ( + [string]$source, + [string]$destination + ) + + if (Test-Path $destination) + { + $overwrite = Read-Host "File $destination exists. Overwrite? (y/n)" + if ($overwrite -ne 'y') + { + Write-Host "Skipping $destination" -ForegroundColor Yellow + return + } + } + Copy-Item -Path $source -Destination $destination -Force } +} + +# Copy the main Alacritty configuration file +CopyFileWithPrompt "$dotfilesRepo\alacritty\alacritty.toml" "$alacrittyConfigDir\alacritty.toml" + +# Setting up PowerShell Profile +Write-Host "Setting up PowerShell profile..." -ForegroundColor Cyan +CopyFileWithPrompt "$dotfilesRepo\PowerShell\Microsoft.PowerShell_profile.ps1" $psProfile + +# Final message +Write-Host "Windows setup complete!" -ForegroundColor Green