Skip to content

Commit

Permalink
Add checkup for main bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
Ash258 committed Jan 31, 2019
1 parent 147d49b commit c00c0a1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/diagnostic.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Diagnostic tests.
Return $true if the test passed, otherwise $false.
Use 'warn' to highlight the issue, and follow up with the recommended actions to rectify.
#>

. "$PSScriptRoot\buckets.ps1"

function check_windows_defender($global) {
$defender = get-service -name WinDefend -errorAction SilentlyContinue
Expand All @@ -27,3 +27,14 @@ function check_windows_defender($global) {
}
return $true
}

function check_main_bucket {
if (@(buckets) -notcontains 'main'){
warn 'Main bucket is not added.'
Write-Host " run 'scoop bucket add main'"

return $false
}

return $true
}
1 change: 1 addition & 0 deletions libexec/scoop-checkup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ $issues = 0

$issues += !(check_windows_defender $false)
$issues += !(check_windows_defender $true)
$issues += !(check_main_bucket)

$globaldir = New-Object System.IO.DriveInfo($globaldir)
if($globaldir.DriveFormat -ne 'NTFS') {
Expand Down

0 comments on commit c00c0a1

Please sign in to comment.