mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-01-10 07:58:12 +01:00
general: Create dirs first.
This commit is contained in:
parent
47502c29a9
commit
6e5f82bdcf
@ -15,7 +15,7 @@ import os
|
|||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from .settings import __version__, CACHE_DIR
|
from .settings import __version__, CACHE_DIR, CONF_DIR
|
||||||
from . import colors
|
from . import colors
|
||||||
from . import export
|
from . import export
|
||||||
from . import image
|
from . import image
|
||||||
@ -186,6 +186,9 @@ def parse_args(parser):
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Main script function."""
|
"""Main script function."""
|
||||||
|
util.create_dir(os.path.join(CONF_DIR, "templates"))
|
||||||
|
util.create_dir(os.path.join(CONF_DIR, "colorschemes"))
|
||||||
|
|
||||||
util.setup_logging()
|
util.setup_logging()
|
||||||
parser = get_args()
|
parser = get_args()
|
||||||
|
|
||||||
|
@ -54,7 +54,6 @@ def every(colors, output_dir=CACHE_DIR):
|
|||||||
colors = flatten_colors(colors)
|
colors = flatten_colors(colors)
|
||||||
template_dir = os.path.join(MODULE_DIR, "templates")
|
template_dir = os.path.join(MODULE_DIR, "templates")
|
||||||
template_dir_user = os.path.join(CONF_DIR, "templates")
|
template_dir_user = os.path.join(CONF_DIR, "templates")
|
||||||
util.create_dir(template_dir_user)
|
|
||||||
|
|
||||||
join = os.path.join # Minor optimization.
|
join = os.path.join # Minor optimization.
|
||||||
for file in [*os.scandir(template_dir),
|
for file in [*os.scandir(template_dir),
|
||||||
|
@ -56,8 +56,6 @@ def file(input_file):
|
|||||||
user_theme_file = os.path.join(CONF_DIR, "colorschemes", theme_name)
|
user_theme_file = os.path.join(CONF_DIR, "colorschemes", theme_name)
|
||||||
theme_file = os.path.join(MODULE_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.
|
# Find the theme file.
|
||||||
if os.path.isfile(input_file):
|
if os.path.isfile(input_file):
|
||||||
theme_file = input_file
|
theme_file = input_file
|
||||||
|
Loading…
Reference in New Issue
Block a user