mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Packages (Windows): don't rely on the existance of $SCOOP when detecting scoop packages
Fix #1868
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "packages.h"
|
||||
#include "common/processing.h"
|
||||
#include "util/stringUtils.h"
|
||||
#include "util/path.h"
|
||||
|
||||
#include <handleapi.h>
|
||||
#include <fileapi.h>
|
||||
@@ -37,10 +38,11 @@ static void detectScoop(FFPackagesResult* result)
|
||||
{
|
||||
FF_STRBUF_AUTO_DESTROY scoopPath = ffStrbufCreateA(MAX_PATH + 3);
|
||||
|
||||
const char* scoopEnv = getenv("SCOOP");
|
||||
if(ffStrSet(scoopEnv))
|
||||
if(ffFindExecutableInPath("scoop.cmd", &scoopPath) == NULL)
|
||||
{
|
||||
ffStrbufAppendS(&scoopPath, scoopEnv);
|
||||
// C:\Users\$USER\scoop\shims\scoop.cmd
|
||||
ffStrbufSubstrBeforeLastC(&scoopPath, '\\');
|
||||
ffStrbufSubstrBeforeLastC(&scoopPath, '\\');
|
||||
ffStrbufAppendS(&scoopPath, "/apps/*");
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user