From d1af07ea0614ee5d5a3f62a72fd9eef304f31665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Sat, 21 Oct 2017 23:01:24 -0400 Subject: [PATCH] Test --- init_db.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/init_db.py b/init_db.py index 78692351b..1b6393284 100644 --- a/init_db.py +++ b/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')