Skip to content

Commit 41af92b

Browse files
committed
Prevent config from being reset
1 parent ef7ea79 commit 41af92b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

utils/config.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
import os
33

44
def create_config():
5-
config = {
6-
"available_webhook": "",
7-
"updates_webhook": "",
8-
"archives_webhook": ""
9-
}
10-
with open("config.yml", 'w') as f:
11-
yaml.dump(config, f)
12-
return config
5+
if not os.path.exists("config.yml"):
6+
config = {
7+
"available_webhook": "",
8+
"updates_webhook": "",
9+
"archives_webhook": ""
10+
}
11+
with open("config.yml", 'w') as f:
12+
yaml.dump(config, f)
1313

1414
def get_config():
1515
if not os.path.exists("config.yml"):

0 commit comments

Comments
 (0)