mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Fix unix ignore hidden files
This commit is contained in:
@@ -372,14 +372,13 @@ void Eluna::GetScripts(std::string path)
|
|||||||
std::string fullpath = dir_iter->path().generic_string();
|
std::string fullpath = dir_iter->path().generic_string();
|
||||||
|
|
||||||
// Check if file is hidden
|
// Check if file is hidden
|
||||||
#ifdef WIN32
|
#if PLATFORM == PLATFORM_WINDOWS
|
||||||
DWORD dwAttrib = GetFileAttributes(fullpath.c_str());
|
DWORD dwAttrib = GetFileAttributes(fullpath.c_str());
|
||||||
if (dwAttrib != INVALID_FILE_ATTRIBUTES && (dwAttrib & FILE_ATTRIBUTE_HIDDEN))
|
if (dwAttrib != INVALID_FILE_ATTRIBUTES && (dwAttrib & FILE_ATTRIBUTE_HIDDEN))
|
||||||
continue;
|
continue;
|
||||||
#endif
|
#else
|
||||||
#ifdef UNIX
|
|
||||||
std::string name = dir_iter->path().filename().generic_string().c_str();
|
std::string name = dir_iter->path().filename().generic_string().c_str();
|
||||||
if (name != ".." || name != "." || name[0] == '.')
|
if (name[0] == '.')
|
||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -420,14 +419,13 @@ void Eluna::GetScripts(std::string path)
|
|||||||
std::string fullpath = path + "/" + directory->d_name;
|
std::string fullpath = path + "/" + directory->d_name;
|
||||||
|
|
||||||
// Check if file is hidden
|
// Check if file is hidden
|
||||||
#ifdef WIN32
|
#if PLATFORM == PLATFORM_WINDOWS
|
||||||
DWORD dwAttrib = GetFileAttributes(fullpath.c_str());
|
DWORD dwAttrib = GetFileAttributes(fullpath.c_str());
|
||||||
if (dwAttrib != INVALID_FILE_ATTRIBUTES && (dwAttrib & FILE_ATTRIBUTE_HIDDEN))
|
if (dwAttrib != INVALID_FILE_ATTRIBUTES && (dwAttrib & FILE_ATTRIBUTE_HIDDEN))
|
||||||
continue;
|
continue;
|
||||||
#endif
|
#else
|
||||||
#ifdef UNIX
|
|
||||||
std::string name = directory->d_name.c_str();
|
std::string name = directory->d_name.c_str();
|
||||||
if (name != ".." || name != "." || name[0] == '.')
|
if (name[0] == '.')
|
||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user