From f19207d4f7c2e3d5f18a62239758c6e199511409 Mon Sep 17 00:00:00 2001 From: Rashil Gandhi Date: Wed, 16 Feb 2022 23:51:34 +0530 Subject: [PATCH] Simplify Scoop function --- winfetch.ps1 | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/winfetch.ps1 b/winfetch.ps1 index 8294506..812825e 100644 --- a/winfetch.ps1 +++ b/winfetch.ps1 @@ -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 }