diff --git a/RdzeN-Profile.ps1 b/RdzeN-Profile.ps1 index dd294c4..dfefce2 100644 --- a/RdzeN-Profile.ps1 +++ b/RdzeN-Profile.ps1 @@ -35,6 +35,7 @@ try { } # 3. Download GIT REPO +$git_repo_update = $null # Function to pull repository function Pull-Repository { Set-Location $path_gitea_powershell_profile @@ -49,11 +50,13 @@ function Pull-Repository { if ($git_tmp -match "(Your branch is up to date)") { $git_tmp | ForEach-Object { Write-Host $_ -ForegroundColor Green + $git_repo_update = $false } } else { $git_tmp | ForEach-Object { Write-Host $_ -ForegroundColor Red } + $git_repo_update = $true Pull-Repository } @@ -69,6 +72,11 @@ Get-ChildItem $path_to_search | ForEach-Object { } } +if ($git_repo_update -eq $true) { + Override-Profile + Reload-Profile +} + $found_functions = $found_functions | Sort-Object for ($i = 0; $i -lt $found_functions.Count; $i++) { diff --git a/functions/Reload-Profile.ps1 b/functions/Reload-Profile.ps1 index eff52f6..0529748 100644 --- a/functions/Reload-Profile.ps1 +++ b/functions/Reload-Profile.ps1 @@ -1,13 +1,5 @@ # gitea.RdzeN.net # Reload $profile function Reload-Profile { - Write-Host "Do you want to reload your PS profile?" - do { - $reload = Read-Host "Type [Y]es or [N]o" - } until ( - $reload -in ("Y","N") - ) - if ($reload -eq "Y") { - . $PROFILE - } + . $PROFILE } \ No newline at end of file