Преглед изворни кода

auto-create logs folder if not created

bigbrodude6119 пре 2 година
родитељ
комит
9c46c560e4
1 измењених фајлова са 4 додато и 0 уклоњено
  1. 4 0
      helpers/evil_portal_storage.c

+ 4 - 0
helpers/evil_portal_storage.c

@@ -97,6 +97,10 @@ char *sequential_file_resolve_path(Storage *storage, const char *dir,
 void write_logs(char *portal_logs) {
   Storage *storage = evil_portal_open_storage();
 
+  if(!storage_file_exists(storage, EVIL_PORTAL_LOG_SAVE_PATH)) {
+    storage_simply_mkdir(storage, EVIL_PORTAL_LOG_SAVE_PATH);
+  }
+
   char *seq_file_path = sequential_file_resolve_path(
       storage, EVIL_PORTAL_LOG_SAVE_PATH, "log", "txt");