mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-01 23:35:41 +00:00
Fix hot reload not working with symlinked entire plugins (#230)
This commit is contained in:
commit
d65f3cf75b
@ -1,6 +1,7 @@
|
|||||||
#include "TPluginMonitor.h"
|
#include "TPluginMonitor.h"
|
||||||
|
|
||||||
#include "TLuaEngine.h"
|
#include "TLuaEngine.h"
|
||||||
|
#include <filesystem>
|
||||||
|
|
||||||
TPluginMonitor::TPluginMonitor(const fs::path& Path, std::shared_ptr<TLuaEngine> Engine)
|
TPluginMonitor::TPluginMonitor(const fs::path& Path, std::shared_ptr<TLuaEngine> Engine)
|
||||||
: mEngine(Engine)
|
: mEngine(Engine)
|
||||||
@ -9,7 +10,7 @@ TPluginMonitor::TPluginMonitor(const fs::path& Path, std::shared_ptr<TLuaEngine>
|
|||||||
if (!fs::exists(mPath)) {
|
if (!fs::exists(mPath)) {
|
||||||
fs::create_directories(mPath);
|
fs::create_directories(mPath);
|
||||||
}
|
}
|
||||||
for (const auto& Entry : fs::recursive_directory_iterator(mPath)) {
|
for (const auto& Entry : fs::recursive_directory_iterator(mPath, fs::directory_options::follow_directory_symlink)) {
|
||||||
// TODO: trigger an event when a subfolder file changes
|
// TODO: trigger an event when a subfolder file changes
|
||||||
if (Entry.is_regular_file()) {
|
if (Entry.is_regular_file()) {
|
||||||
mFileTimes[Entry.path().string()] = fs::last_write_time(Entry.path());
|
mFileTimes[Entry.path().string()] = fs::last_write_time(Entry.path());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user