From c4063347519423ef24cfb8e2a2568dcf998fa4bf Mon Sep 17 00:00:00 2001 From: "Arjun G. Menon" Date: Tue, 30 Jul 2024 03:19:54 -0400 Subject: [PATCH] Do resetOutputDir before Fs analysis --- alteza/engine.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/alteza/engine.py b/alteza/engine.py index 2996a69..6bb386c 100644 --- a/alteza/engine.py +++ b/alteza/engine.py @@ -381,11 +381,7 @@ def walk(curDir: DirNode) -> None: else: Generate.linkStaticAsset(fileNode, args.copy_assets) - outputDir = args.output - Generate.resetOutputDir(outputDir, args.clear_output_dir) - - print("Generating...") - with enterDir(outputDir): + with enterDir(args.output): walk(content.rootDir) @@ -408,6 +404,8 @@ def run(args: Args) -> None: f"The provided path '{contentDir}' does not exist or is not a directory." ) + Generate.resetOutputDir(args.output, args.clear_output_dir) + with enterDir(args.content): fs = Fs() print(fs.nameRegistry) @@ -419,6 +417,7 @@ def run(args: Args) -> None: print("File Tree:") print(fs.rootDir.displayDir()) + print("Generating...") Generate.generate(args, content) elapsedMilliseconds = (time.time_ns() - startTimeNs) / 10**6