Get rid of data folder on git, add it to gitignore, gen files needed at

boot
This commit is contained in:
Ave Ozkal 2018-12-27 14:13:28 +03:00
parent b04fdc65ee
commit 03cdf7cf3b
No known key found for this signature in database
GPG key ID: 09356ABAA42C842B
4 changed files with 13 additions and 4 deletions

4
.gitignore vendored
View file

@ -100,5 +100,5 @@ files/*
priv-* priv-*
config.py config.py
# Prevent new versions of this from being committed # Prevent data files from being committed
data/warnsv2.json data/

View file

@ -167,4 +167,15 @@ async def on_message(message):
ctx = await bot.get_context(message) ctx = await bot.get_context(message)
await bot.invoke(ctx) await bot.invoke(ctx)
if not os.path.exists("data"):
os.makedirs("data")
wanted_jsons = ["data/restrictions.json",
"data/warnsv2.json"]
for wanted_json in wanted_jsons:
if not os.path.exists(wanted_json):
with open(wanted_json, "w") as f:
f.write("{}")
bot.run(config.token, bot=True, reconnect=True) bot.run(config.token, bot=True, reconnect=True)

View file

@ -1 +0,0 @@
{}

View file

@ -1 +0,0 @@
{}