Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ function Invoke-PackageRestore
$expected | ForEach-Object {
$filePath = $_

$fileName = ($filePath.Replace(("{0}" -f $destinationPath), "")) -replace "([\/\\])", ""
$package = $packages.$fileName

if (Test-Path $filePath -PathType Leaf)
{
$requiredFile = Get-Item -Path $filePath

if ($requiredFile.Length -gt 0)
if ([string]::IsNullOrEmpty($package.hash) -And $(Get-Item -Path $filePath).Length -gt 0 -Or $package.hash -eq $(Get-FileHash -Path $filePath).Hash)
{
Write-Message ("Required package found: '{0}'" -f $filePath) -Level Debug

Expand All @@ -83,9 +84,6 @@ function Invoke-PackageRestore
Remove-Item -Path $filePath -Force
}

$fileName = ($filePath.Replace(("{0}" -f $destinationPath), "")) -replace "([\/\\])", ""
$package = $packages.$fileName

if ($null -eq $package)
{
throw ("Required package '{0}' was not defined in 'sitecore-packages.json' so it can't be downloaded, please add the package ' {1}' manually." -f $fileName, $filePath)
Expand Down Expand Up @@ -138,4 +136,4 @@ function Invoke-PackageRestore

$watch.Stop()
Write-Message "Restore completed. Time: $($watch.Elapsed.ToString("hh\:mm\:ss\.fff"))."
}
}
Loading