Commit 13123a55 authored by shadMod's avatar shadMod 💬

added copytree if path news not exists

parent e9b6c1b3
Pipeline #348 passed with stage
in 0 seconds
......@@ -106,7 +106,9 @@ def init_data_directory(data_path: str):
if os.path.exists(NEWS_PATH):
shutil.rmtree(NEWS_PATH)
shutil.copytree(ROOT_NEWS, NEWS_PATH)
except OSError:
else:
shutil.copytree(ROOT_NEWS, NEWS_PATH)
except OSError as ex:
shutil.copy(ROOT_NEWS, NEWS_PATH)
except Exception as ex:
print(ex)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment