summaryrefslogtreecommitdiff
path: root/pywal
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2018-04-29 19:40:48 +1000
committerDylan Araps <dylan.araps@gmail.com>2018-04-29 19:40:48 +1000
commit6e5f82bdcfcc9f494101b67d2dbca482c1ef420d (patch)
tree77fb265400e8b556b02415aa773565b1576d3293 /pywal
parent47502c29a96cabfca0732c5c6d112a515ff15994 (diff)
general: Create dirs first.
Diffstat (limited to 'pywal')
-rw-r--r--pywal/__main__.py5
-rw-r--r--pywal/export.py1
-rw-r--r--pywal/theme.py2
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