mirror of
https://github.com/Baipyrus/dotfiles.git
synced 2024-12-25 10:51:46 +00:00
bugfix: logic error: pull only if in git repository
This commit is contained in:
parent
0e50978a74
commit
4ab07fb4db
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user