Skip to content

Commit

Permalink
(GH-525) Improve write-progress
Browse files Browse the repository at this point in the history
The write-progress doesn't always write the 100% line out, so have
Get-WebFile state that it has finished downloading the file.
  • Loading branch information
ferventcoder committed Jan 2, 2016
1 parent ab82a78 commit 16d769e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/chocolatey.resources/helpers/functions/Get-WebFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,12 @@ param(
}

if ($total -eq $goal) {
Write-Progress "Completed download of $url." "Completed a total of $total bytes of $fileName" -id 0 -Completed
Write-Progress "Completed download of $url." "Completed download of $fileName ($goalFormatted)." -id 0 -Completed
}
}
} while ($count -gt 0)
Write-Host ""
Write-Host "Download of $([System.IO.Path]::GetFileName($fileName)) ($goalFormatted) completed."
} catch {
throw $_.Exception
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ public override void WriteProgress(long sourceId, ProgressRecord record)
if (record.PercentComplete == 100 && !hasLoggedFinalProgress)
{
hasLoggedFinalProgress = true;
this.Log().Info("");
this.Log().Info(record.StatusDescription.Replace("Saving","Finished downloading. Saved"));
//this.Log().Info("");
//this.Log().Info(record.StatusDescription.Replace("Saving","Finished downloading. Saved"));
}
}

Expand Down

0 comments on commit 16d769e

Please sign in to comment.