Skip to content

Commit

Permalink
Simplify Scoop function
Browse files Browse the repository at this point in the history
  • Loading branch information
rashil2000 committed Feb 16, 2022
1 parent 03ce4ce commit f19207d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions winfetch.ps1
Expand Up @@ -841,14 +841,9 @@ function info_pkgs {
}

if ("scoop" -in $ShowPkgs) {
if (Test-Path "~/scoop/apps") {
$scoopdir = "~/scoop/apps"
} elseif (Get-Command -Name scoop -ErrorAction Ignore) {
$scoop = & scoop which scoop.ps1
$scoopdir = (Resolve-Path "$(Split-Path -Path $scoop)\..\..\..").Path
}
$scoopdir = if ($Env:SCOOP) { "$Env:SCOOP\apps" } else { "$Env:UserProfile\scoop\apps" }

if ($scoopdir) {
if (Test-Path $scoopdir) {
$scooppkg = (Get-ChildItem -Path $scoopdir -Directory).Count - 1
}

Expand Down

0 comments on commit f19207d

Please sign in to comment.