Skip to content

Commit

Permalink
Autocreate Scripts directory if missing
Browse files Browse the repository at this point in the history
Actually it will auto-create any directory you're
monitoring
  • Loading branch information
dennis committed Oct 7, 2021
1 parent 140adfb commit 5a9f271
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Components/FileMonitor/Lua/FileMonitorInstanceThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public FileMonitorInstanceThread(

foreach (var path in paths)
{
// Make sure directory exists, before monitoring it
Directory.CreateDirectory(path);

var watcher = new FileSystemWatcher(path);
watcher.Created += (_, e) => WatcherOnCreated(e);
watcher.Changed += (_, e) => WatcherOnChanged(e);
Expand Down

0 comments on commit 5a9f271

Please sign in to comment.