Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions src/detection/os/os_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,25 @@ FF_A_UNUSED static bool detectFedoraVariant(FFOSResult* result) {
return false;
}

FF_A_UNUSED static bool detectBedrock(FFOSResult* os) {
static bool detectBedrock(FFOSResult* os)
{
const char* bedrockRestrict = getenv("BEDROCK_RESTRICT");
if (bedrockRestrict && bedrockRestrict[0] == '1') {
if (bedrockRestrict && bedrockRestrict[0] == '1')
return false;

if (ffPathExists(
FASTFETCH_TARGET_DIR_ROOT "/bedrock/strata/enux",
FF_PATHTYPE_DIRECTORY) &&
parseOsRelease(
FASTFETCH_TARGET_DIR_ROOT "/bedrock/strata/enux/etc/os-release",
os))
{
return true;
}
Comment on lines +306 to 314

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MEDIUM RISK

If the 'enux' directory exists but the 'os-release' file within it cannot be parsed, the function returns false without attempting to detect the base Bedrock system. This breaks the fallback mechanism. The detection should only return if it successfully finds OS information.

Try running the following prompt in your coding agent:

Refactor the detectBedrock function in src/detection/os/os_linux.c to attempt parsing the enux stratum's os-release first, and only return if it succeeds; otherwise, fall back to parsing the default Bedrock stratum's os-release.

return parseOsRelease(FASTFETCH_TARGET_DIR_ROOT "/bedrock/strata/bedrock/etc/os-release", os);

return parseOsRelease(
FASTFETCH_TARGET_DIR_ROOT "/bedrock/strata/bedrock/etc/os-release",
os);
}
Comment on lines +300 to 319

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ LOW RISK

Nitpick: The function deviates from the project's preference for K&R style braces and mandatory braces for single-line if statements.

Suggested change
static bool detectBedrock(FFOSResult* os)
{
const char* bedrockRestrict = getenv("BEDROCK_RESTRICT");
if (bedrockRestrict && bedrockRestrict[0] == '1') {
if (bedrockRestrict && bedrockRestrict[0] == '1')
return false;
if (ffPathExists(
FASTFETCH_TARGET_DIR_ROOT "/bedrock/strata/enux",
FF_PATHTYPE_DIRECTORY))
{
return parseOsRelease(
FASTFETCH_TARGET_DIR_ROOT "/bedrock/strata/enux/etc/os-release",
os);
}
return parseOsRelease(FASTFETCH_TARGET_DIR_ROOT "/bedrock/strata/bedrock/etc/os-release", os);
return parseOsRelease(
FASTFETCH_TARGET_DIR_ROOT "/bedrock/strata/bedrock/etc/os-release",
os);
}
static bool detectBedrock(FFOSResult* os) {
const char* bedrockRestrict = getenv("BEDROCK_RESTRICT");
if (bedrockRestrict && bedrockRestrict[0] == '1') {
return false;
}
if (ffPathExists(FASTFETCH_TARGET_DIR_ROOT "/bedrock/strata/enux", FF_PATHTYPE_DIRECTORY)) {
if (parseOsRelease(FASTFETCH_TARGET_DIR_ROOT "/bedrock/strata/enux/etc/os-release", os)) {
return true;
}
}
return parseOsRelease(FASTFETCH_TARGET_DIR_ROOT "/bedrock/strata/bedrock/etc/os-release", os);
}


FF_A_UNUSED static void detectDeepinEnhancement(FFOSResult* result) {
Expand Down
13 changes: 13 additions & 0 deletions src/logo/ascii/e.inc
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,19 @@ static const FFlogo E[] = {
.colorTitle = FF_COLOR_FG_DEFAULT,
},
#endif
#ifdef FASTFETCH_DATATEXT_LOGO_ENUX
// ENux
{
.names = { "enux" },
.lines = FASTFETCH_DATATEXT_LOGO_ENUX,
// ENux renders entirely black: logo, keys, and title.
.colors = {
FF_COLOR_FG_BLACK,
},
.colorKeys = FF_COLOR_FG_BLACK,
.colorTitle = FF_COLOR_FG_BLACK,
Comment on lines +161 to +165

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MEDIUM RISK

Suggestion: Using FF_COLOR_FG_BLACK for the logo, keys, and title will make the output invisible on dark-themed terminals. While this matches ENux branding, it is better to use FF_COLOR_FG_DEFAULT or FF_COLOR_FG_LIGHT_BLACK to ensure accessibility for the majority of users.

},
#endif
#ifdef FASTFETCH_DATATEXT_LOGO_ESHANIZEDOS
// EshanizedOS
{
Expand Down
12 changes: 12 additions & 0 deletions src/logo/ascii/e/enux.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
eeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeee
eeeee
eeeee
eeeee
eeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeee
eeeee
eeeee
eeeee
eeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeee