Skip to content

Commit f19207d

Browse files
committed
Simplify Scoop function
1 parent 03ce4ce commit f19207d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

winfetch.ps1

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -841,14 +841,9 @@ function info_pkgs {
841841
}
842842

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

851-
if ($scoopdir) {
846+
if (Test-Path $scoopdir) {
852847
$scooppkg = (Get-ChildItem -Path $scoopdir -Directory).Count - 1
853848
}
854849

0 commit comments

Comments
 (0)