refactored project structure

This commit is contained in:
Linus Dierheimer
2021-02-27 16:40:05 +01:00
parent 558639086a
commit b44ab16dd1
26 changed files with 219 additions and 211 deletions
+25
View File
@@ -0,0 +1,25 @@
#include "fastfetch.h"
#include <string.h>
void ffPrintShell(FFstate* state)
{
if(ffPrintCachedValue(state, "Shell"))
return;
char* shellPath = getenv("SHELL");
if(shellPath == NULL)
{
ffPrintError(state, "Shell", "getenv(\"SHELL\") == NULL");
return;
}
char* shellName = strrchr(shellPath, '/');
if(shellName == NULL)
shellName = shellPath;
else if(shellName[0] == '/')
++shellName;
ffPrintAndSaveCachedValue(state, "Shell", shellName);
}