From 6e5f82bdcfcc9f494101b67d2dbca482c1ef420d Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 29 Apr 2018 19:40:48 +1000 Subject: [PATCH] general: Create dirs first. --- pywal/__main__.py | 5 ++++- pywal/export.py | 1 - pywal/theme.py | 2 -- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pywal/__main__.py b/pywal/__main__.py index a8e2a87..1322c5b 100644 --- a/pywal/__main__.py +++ b/pywal/__main__.py @@ -15,7 +15,7 @@ import os import shutil import sys -from .settings import __version__, CACHE_DIR +from .settings import __version__, CACHE_DIR, CONF_DIR from . import colors from . import export from . import image @@ -186,6 +186,9 @@ def parse_args(parser): def main(): """Main script function.""" + util.create_dir(os.path.join(CONF_DIR, "templates")) + util.create_dir(os.path.join(CONF_DIR, "colorschemes")) + util.setup_logging() parser = get_args() diff --git a/pywal/export.py b/pywal/export.py index 993e528..8d5b33f 100644 --- a/pywal/export.py +++ b/pywal/export.py @@ -54,7 +54,6 @@ def every(colors, output_dir=CACHE_DIR): colors = flatten_colors(colors) template_dir = os.path.join(MODULE_DIR, "templates") template_dir_user = os.path.join(CONF_DIR, "templates") - util.create_dir(template_dir_user) join = os.path.join # Minor optimization. for file in [*os.scandir(template_dir), diff --git a/pywal/theme.py b/pywal/theme.py index 4d42156..cbf9354 100644 --- a/pywal/theme.py +++ b/pywal/theme.py @@ -56,8 +56,6 @@ def file(input_file): user_theme_file = os.path.join(CONF_DIR, "colorschemes", theme_name) theme_file = os.path.join(MODULE_DIR, "colorschemes", theme_name) - util.create_dir(os.path.dirname(user_theme_file)) - # Find the theme file. if os.path.isfile(input_file): theme_file = input_file