1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-23 16:23:41 +00:00

Data directory creation if missing

This commit is contained in:
Louis Vézina 2017-10-21 22:51:15 -04:00
parent c1fccc1d1f
commit ef1e6edbfb

View file

@ -5,6 +5,12 @@ import sqlite3
if os.path.exists(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db')) == True:
pass
else:
# Create data directory tree
os.mkdir(os.path.join(os.path.dirname(__file__), 'data'))
os.mkdir(os.path.join(os.path.dirname(__file__), 'data/cache'))
os.mkdir(os.path.join(os.path.dirname(__file__), 'data/db'))
os.mkdir(os.path.join(os.path.dirname(__file__), 'data/log'))
# Get SQL script from file
fd = open(os.path.join(os.path.dirname(__file__), 'create_db.sql'), 'r')
script = fd.read()