diff --git a/userconfig.py b/userconfig.py index 1bc17fa..cfa52e6 100755 --- a/userconfig.py +++ b/userconfig.py @@ -47,7 +47,6 @@ def workconf(directory, depth=2): for d in dirs: name = directory+"/"+d if os.path.isdir(name): - # fixme: create name if it does not exist workconf(name, depth+1) if name.endswith(".swp"): continue @@ -167,6 +166,12 @@ def process_all_files(destfiles, dir_config): debug.debug(" ================ process_all_files ===============", 1) for df in destfiles.keys(): debug.debug(" ??? Processing source files for %s." % df, 2) + if not os.path.exists(os.path.dirname(df)): + debug.debug(" +++ Directory %s does not exist, creating" % os.path.dirname(df), 1) + os.mkdir(os.path.dirname(df)) + if not os.path.isdir(os.path.dirname(df)): + debug.debug(" --- Destination directory %s does not exist, skipping." % os.path.dirname(df), 1) + return False # assemble file to tmp commentstring = "" if dir_config.check("Main", "commentstring"):