Skip to content

Commit 3a8cd48

Browse files
committed
Address feedback
Signed-off-by: crueter <[email protected]>
1 parent 44977ed commit 3a8cd48

File tree

3 files changed

+5
-24
lines changed

3 files changed

+5
-24
lines changed

Scripts/InstallFEX.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,4 +420,4 @@ def main():
420420
ExitWithStatus(0)
421421

422422
if __name__ == "__main__":
423-
sys.exit(main())
423+
sys.exit(main())

Source/Common/Config.cpp

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <FEXHeaderUtils/SymlinkChecks.h>
1313

1414
#include <cstring>
15-
#include <filesystem>
1615
#include <fmt/format.h>
1716
#include <functional>
1817
#ifndef _WIN32
@@ -571,16 +570,11 @@ fextl::string GetDataDirectory(bool Global, const PortableInformation& PortableI
571570
// Data override will override the complete directory
572571
DataDir = DataOverride;
573572
} else {
574-
DataDir = DataXDG ?: fallback;
573+
DataDir = DataXDG ? DataXDG : fallback;
575574
DataDir += "/fex-emu/";
576575
}
577576
}
578577

579-
// Ensure the folder structure is created for our configuration
580-
if (!FHU::Filesystem::Exists(DataDir) && !FHU::Filesystem::CreateDirectories(DataDir)) {
581-
// Let's go local in this case
582-
return "./";
583-
}
584578
return DataDir;
585579
}
586580

@@ -618,15 +612,9 @@ fextl::string GetConfigDirectory(bool Global, const PortableInformation& Portabl
618612
// Config override will override the complete directory
619613
ConfigDir = ConfigOverride;
620614
} else {
621-
ConfigDir = ConfigXDG ?: fallback;
615+
ConfigDir = ConfigXDG ? ConfigXDG : fallback;
622616
ConfigDir += "/fex-emu/";
623617
}
624-
625-
// Ensure the folder structure is created for our configuration
626-
if (!FHU::Filesystem::Exists(ConfigDir) && !FHU::Filesystem::CreateDirectories(ConfigDir)) {
627-
// Let's go local in this case
628-
return "./";
629-
}
630618
}
631619

632620
return ConfigDir;
@@ -650,18 +638,12 @@ fextl::string GetCacheDirectory() {
650638
const char* HomeDir = GetHomeDirectory();
651639
const char* CacheXDG = getenv("XDG_CACHE_HOME");
652640

653-
// use~/.cache if XDG_CACHE_HOME is unset
641+
// use ~/.cache if XDG_CACHE_HOME is unset
654642
const std::string fallback = fmt::format("{}/.cache", HomeDir);
655643

656-
CacheDir = CacheXDG ?: fallback;
644+
CacheDir = CacheXDG ? CacheXDG : fallback;
657645
CacheDir += "/fex-emu/";
658646

659-
// Ensure the folder structure is created for our Cacheuration
660-
if (!FHU::Filesystem::Exists(CacheDir) && !FHU::Filesystem::CreateDirectories(CacheDir)) {
661-
// Let's go local in this case
662-
return "./";
663-
}
664-
665647
return CacheDir;
666648

667649
#else

Source/Common/FEXServerClient.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ fextl::string GetTempFolder() {
9797

9898
// Fallback to `/tmp/` if no env vars are set.
9999
// Might not be ideal but we don't have much of a choice.
100-
// TODO: mkdtemp()
101100
return fextl::string {"/tmp"};
102101
}
103102

0 commit comments

Comments
 (0)