Skip to content

Commit

Permalink
Fix function name and remove negation ScoopInstaller#3549
Browse files Browse the repository at this point in the history
  • Loading branch information
nimzo6689 committed Jul 19, 2019
1 parent 0bc917b commit b01fd2f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions libexec/scoop-status.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,33 @@

reset_aliases

function Test-GitRepoLatest($location) {
function Test-IsGitRepositoryBehind($location) {
Push-Location $location
git_fetch -q origin
$is_behind = (git_status) -like '*is behind*' -as [bool]
Pop-Location

return !($is_behind)
return $is_behind
}

function Test-ScoopLatest {
$currentdir = fullpath $(versiondir 'scoop' 'current')
if (!(Test-Path "$currentdir\.git") -or !(Test-GitRepoLatest $currentdir)) {
return $false
function Test-IsScoopBehind {
$currentdir = fullpath (versiondir 'scoop' 'current')
if (!(Test-Path "$currentdir\.git") -or (Test-IsGitRepositoryBehind $currentdir)) {
return $true
}

foreach ($bucket in Get-LocalBucket) {
$loc = Find-BucketDirectory $bucket -Root
if (!(Test-GitRepoLatest $loc)) {
return $false
if (Test-IsGitRepositoryBehind $loc) {
return $true
}
}

return $true
return $false
}

# check if scoop needs updating
$needs_update = !(Test-ScoopLatest)
$needs_update = Test-IsScoopBehind
if ($needs_update) {
warn "Scoop is out of date. Run 'scoop update' to get the latest changes."
}
Expand Down

0 comments on commit b01fd2f

Please # to comment.