Skip to content

Commit

Permalink
Add config option "show_update_log" (#2133)
Browse files Browse the repository at this point in the history
  • Loading branch information
r15ch13 committed Mar 21, 2018
1 parent f3f559c commit d68cb3c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions libexec/scoop-update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ function update_scoop() {

write-host "Updating Scoop..."
$last_update = $(last_scoop_update).ToString('s')
$show_update_log = get_config "show_update_log"
if($show_update_log -eq $null) {
$show_update_log = $true
}
$currentdir = fullpath $(versiondir 'scoop' 'current')
if(!(test-path "$currentdir\.git")) {
$newdir = fullpath $(versiondir 'scoop' 'new')
Expand All @@ -74,7 +78,9 @@ function update_scoop() {
Push-Location $currentdir
git_pull -q
$res = $lastexitcode
git_log --no-decorate --date=local --since="`"$last_update`"" --format="`"tformat: * %C(yellow)%h%Creset %<|(72,trunc)%s %C(cyan)%cr%Creset`"" HEAD
if($show_update_log) {
git_log --no-decorate --date=local --since="`"$last_update`"" --format="`"tformat: * %C(yellow)%h%Creset %<|(72,trunc)%s %C(cyan)%cr%Creset`"" HEAD
}
if($res -ne 0) {
abort 'Update failed.'
}
Expand All @@ -88,7 +94,9 @@ function update_scoop() {
write-host "Updating '$_' bucket..."
Push-Location (bucketdir $_)
git_pull -q
git_log --no-decorate --date=local --since="`"$last_update`"" --format="`"tformat: * %C(yellow)%h%Creset %<|(72,trunc)%s %C(cyan)%cr%Creset`"" HEAD
if($show_update_log) {
git_log --no-decorate --date=local --since="`"$last_update`"" --format="`"tformat: * %C(yellow)%h%Creset %<|(72,trunc)%s %C(cyan)%cr%Creset`"" HEAD
}
Pop-Location
}

Expand Down

0 comments on commit d68cb3c

Please sign in to comment.