mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-24 08:43:01 +00:00
Data directory creation if missing
This commit is contained in:
parent
c1fccc1d1f
commit
ef1e6edbfb
1 changed files with 6 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue