mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Merge pull request #296 from CarterLi/dev
TerminalShell: fix bash version detection on Windows
This commit is contained in:
@@ -4,16 +4,14 @@
|
||||
static void getShellVersionBash(FFstrbuf* exe, FFstrbuf* version)
|
||||
{
|
||||
ffProcessAppendStdOut(version, (char* const[]) {
|
||||
"env",
|
||||
"-i",
|
||||
exe->chars,
|
||||
"--norc",
|
||||
"--noprofile",
|
||||
"-c",
|
||||
"printf \"%s\" \"$BASH_VERSION\"",
|
||||
"--version",
|
||||
NULL
|
||||
});
|
||||
ffStrbufSubstrBeforeFirstC(version, '(');
|
||||
}); // GNU bash, version 5.1.16(1)-release (x86_64-pc-msys)\nCopyright...
|
||||
ffStrbufSubstrBeforeFirstC(version, '\n'); // GNU bash, version 5.1.16(1)-release (x86_64-pc-msys)
|
||||
ffStrbufSubstrBeforeLastC(version, ' '); // GNU bash, version 5.1.16(1)-release
|
||||
ffStrbufSubstrAfterLastC(version, ' '); // 5.1.16(1)-release
|
||||
ffStrbufSubstrBeforeFirstC(version, '('); // 5.1.16
|
||||
}
|
||||
|
||||
static void getShellVersionZsh(FFstrbuf* exe, FFstrbuf* version)
|
||||
|
||||
Reference in New Issue
Block a user