From 4ab07fb4dbb9d92519d543cb8cdc3fb8d6ba2199 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 28 Nov 2024 15:07:31 +0100 Subject: [PATCH] bugfix: logic error: pull only if in git repository --- util/windows.psm1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/util/windows.psm1 b/util/windows.psm1 index ffa487b..1576f94 100644 --- a/util/windows.psm1 +++ b/util/windows.psm1 @@ -40,15 +40,15 @@ function ReadyDotfilesRepo } # Clone new repo in destination dir if not exists - if (-not (Test-Path $destination)) + if ((Test-Path $destination) -and (IsGitRepository -dir $destination -url $url)) { - Write-Host "Cloning dotfiles repository..." -ForegroundColor Cyan - git clone $url $destination + Write-Host "Pulling latest changes from dotfiles repository..." -ForegroundColor Cyan + Write-Host "$(git -C $destination pull)" return $destination } - Write-Host "Pulling latest changes from dotfiles repository..." -ForegroundColor Cyan - Write-Host "$(git -C $destination pull)" + Write-Host "Cloning dotfiles repository..." -ForegroundColor Cyan + git clone $url $destination return $destination }