mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-01-01 12:32:25 +08:00
Test
This commit is contained in:
parent
ef1e6edbfb
commit
d1af07ea06
1 changed files with 19 additions and 4 deletions
23
init_db.py
23
init_db.py
|
@ -6,10 +6,25 @@ if os.path.exists(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'))
|
|||
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'))
|
||||
try:
|
||||
os.mkdir(os.path.join(os.path.dirname(__file__), 'data'))
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
try:
|
||||
os.mkdir(os.path.join(os.path.dirname(__file__), 'data/cache'))
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
try:
|
||||
os.mkdir(os.path.join(os.path.dirname(__file__), 'data/db'))
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
try:
|
||||
os.mkdir(os.path.join(os.path.dirname(__file__), 'data/log'))
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
# Get SQL script from file
|
||||
fd = open(os.path.join(os.path.dirname(__file__), 'create_db.sql'), 'r')
|
||||
|
|
Loading…
Reference in a new issue