From 3093cce32718306025e887d7c9f93d5ad75739f5 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 18 Mar 2018 15:50:38 +1100 Subject: [PATCH] misc: cleanup --- pywal/__main__.py | 3 --- pywal/export.py | 2 ++ pywal/theme.py | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pywal/__main__.py b/pywal/__main__.py index 97eb999..00a2004 100644 --- a/pywal/__main__.py +++ b/pywal/__main__.py @@ -164,9 +164,6 @@ def process_args(args): def main(): """Main script function.""" - util.create_dir(os.path.join(CONF_DIR, "colorschemes")) - util.create_dir(os.path.join(CONF_DIR, "templates")) - args = get_args(sys.argv[1:]) process_args(args) diff --git a/pywal/export.py b/pywal/export.py index 87185f6..ca5f7a7 100644 --- a/pywal/export.py +++ b/pywal/export.py @@ -54,6 +54,8 @@ def every(colors, output_dir=CACHE_DIR): 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 efa3129..6d0acdc 100644 --- a/pywal/theme.py +++ b/pywal/theme.py @@ -36,6 +36,8 @@ 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