FileUtil: Refactor CreateSysDirectoryPath()

This commit is contained in:
Dentomologist 2022-05-27 23:49:28 -07:00
parent c2be78079c
commit e0c9ae16b9
1 changed files with 7 additions and 10 deletions

View File

@ -887,8 +887,6 @@ std::string GetExeDirectory()
static std::string CreateSysDirectoryPath()
{
std::string sysDir;
#if defined(_WIN32) || defined(LINUX_LOCAL_DEV)
#define SYSDATA_DIR "Sys"
#elif defined __APPLE__
@ -902,19 +900,18 @@ static std::string CreateSysDirectoryPath()
#endif
#if defined(__APPLE__)
sysDir = GetBundleDirectory() + DIR_SEP + SYSDATA_DIR;
const std::string sys_directory = GetBundleDirectory() + DIR_SEP SYSDATA_DIR DIR_SEP;
#elif defined(_WIN32) || defined(LINUX_LOCAL_DEV)
sysDir = GetExeDirectory() + DIR_SEP + SYSDATA_DIR;
const std::string sys_directory = GetExeDirectory() + DIR_SEP SYSDATA_DIR DIR_SEP;
#elif defined ANDROID
sysDir = s_android_sys_directory;
ASSERT_MSG(COMMON, !sysDir.empty(), "Sys directory has not been set");
const std::string sys_directory = s_android_sys_directory + DIR_SEP;
ASSERT_MSG(COMMON, !s_android_sys_directory.empty(), "Sys directory has not been set");
#else
sysDir = SYSDATA_DIR;
const std::string sys_directory = SYSDATA_DIR DIR_SEP;
#endif
sysDir += DIR_SEP;
INFO_LOG_FMT(COMMON, "CreateSysDirectoryPath: Setting to {}", sysDir);
return sysDir;
INFO_LOG_FMT(COMMON, "CreateSysDirectoryPath: Setting to {}", sys_directory);
return sys_directory;
}
const std::string& GetSysDirectory()