mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 16:26:39 +01:00
specific fish version code
This commit is contained in:
@@ -166,6 +166,18 @@ static void getShellVersionZsh(FFstrbuf* exe, FFstrbuf* version)
|
||||
});
|
||||
}
|
||||
|
||||
static void getShellVersionFish(FFstrbuf* exe, FFstrbuf* version)
|
||||
{
|
||||
ffProcessAppendStdOut(version, (char* const[]) {
|
||||
"env",
|
||||
"-i",
|
||||
exe->chars,
|
||||
"-c",
|
||||
"printf \"%s\" \"$FISH_VERSION\"",
|
||||
NULL
|
||||
});
|
||||
}
|
||||
|
||||
static void getShellVersionGeneric(FFstrbuf* exe, const char* exeName, FFstrbuf* version)
|
||||
{
|
||||
FFstrbuf command;
|
||||
@@ -194,6 +206,8 @@ static void getShellVersion(FFstrbuf* exe, const char* exeName, FFstrbuf* versio
|
||||
getShellVersionBash(exe, version);
|
||||
else if(strcasecmp(exeName, "zsh") == 0)
|
||||
getShellVersionZsh(exe, version);
|
||||
else if(strcasecmp(exeName, "fish") == 0)
|
||||
getShellVersionFish(exe, version);
|
||||
else
|
||||
getShellVersionGeneric(exe, exeName, version);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user